[U-Boot] [PATCH v6 07/17] dm: Add README for driver model
Gerhard Sittig
gsi at denx.de
Sun Nov 10 19:17:31 CET 2013
On Thu, Nov 07, 2013 at 09:32 -0700, Simon Glass wrote:
>
> +Declaring Drivers
> +-----------------
> +
> +A driver declaration looks something like this (see
> +drivers/demo/demo-shape.c):
> +
> +static const struct demo_ops simple_ops = {
> + .hello = shape_hello,
> + .status = shape_status,
> +};
> +
> +U_BOOT_DRIVER(demo_shape_drv) = {
> + .name = "demo_shape_drv",
> + .id = UCLASS_DEMO,
> + .ops = &simple_ops,
> + .priv_data_size = sizeof(struct shape_data),
> +};
Should the variable 'simple_ops' be named 'shape_ops' or
'demo_shape_ops', to better reflect that it's the list of
operations for the 'shape' driver which implements the 'demo'
class API? Because 'simple' is found nowhere else in this
example.
> +Things to punt for later
> +------------------------
> +
> [ ... ]
> +
> +For pre-relocation we can simply call the driver model init function. Then
> +post relocation we throw that away and re-init driver model again. For drivers
> +which require some sort of continuity between pre- and post-relocation
> +devices, we can provide access to the pre-relocatoin device pointers.
s/relocatoin/relocation/
virtually yours
Gerhard Sittig
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr. 5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
More information about the U-Boot
mailing list