[U-Boot] [PATCH v6 07/17] dm: Add README for driver model

Simon Glass sjg at chromium.org
Sun Feb 16 16:32:13 CET 2014


Hi Gerhard,

On 10 November 2013 11:17, Gerhard Sittig <gsi at denx.de> wrote:
> 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.

Yes, will fix, thanks.

>
>
>> +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/

Will fix.

Regards,
Simon


More information about the U-Boot mailing list