On 19 April 2015 at 07:24, Simon Glass <[email protected]> wrote:
> Hi Przemyslaw,
>
> On 15 April 2015 at 05:07, Przemyslaw Marczak <[email protected]> wrote:
>> This commit extends the driver model device's API by function:
>> - dev_get_driver_ops()
>>
>> And this function returns the device's driver's operations if given:
>> - dev pointer, is non-NULL
>> - dev->driver->ops pointer, is non-NULL
>> in other case the, the NULL pointer is returned.
>>
>> Signed-off-by: Przemyslaw Marczak <[email protected]>
>> Cc: Simon Glass <[email protected]>
>> ---
>> Changes V4:
>> - new commit
>> ---
>>  drivers/core/device.c |  8 ++++++++
>>  include/dm/device.h   | 11 +++++++++++
>>  2 files changed, 19 insertions(+)
>>
>> diff --git a/drivers/core/device.c b/drivers/core/device.c
>> index 80eb55b..d024abb 100644
>> --- a/drivers/core/device.c
>> +++ b/drivers/core/device.c
>> @@ -499,6 +499,14 @@ ulong dev_get_driver_data(struct udevice *dev)
>>         return dev->driver_data;
>>  }
>>
>> +const void *dev_get_driver_ops(struct udevice *dev)
>> +{
>> +       if (!dev || !dev->driver->ops)
>
> The second condition seems redundant to me. Perhaps it will become an
> assert or other check one day. Anyway:
>
> Acked-by: Simon Glass <[email protected]>

Applied to u-boot-dm, thanks!
_______________________________________________
U-Boot mailing list
[email protected]
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to