[PATCH 4/4] powerpc: Add uevent handler for ibmebus

Sylvain Munaut tnt at 246tNt.com
Tue Dec 19 10:09:11 EST 2006


Arnd Bergmann wrote:
> On Monday 18 December 2006 23:46, Sylvain Munaut wrote:
>   
>> +       struct ibmebus_dev *ebus_dev;
>> +       struct of_device *of;
>> +
>> +       if (!dev)
>> +               return -ENODEV;
>> +
>> +       ebus_dev = to_ibmebus_dev(dev);
>> +       if (!ebus_dev)
>> +               return -ENODEV;
>> +
>> +       of = &ebus_dev->ofdev;
>>     
>
> This can be shortened to 
>
> 	of = to_of_device(dev);
>
> With that code in place, this function is identical to those
> for macio and of_platform_device, and you can collapse them
> all into of_device_uevent.
>
> 	Arnd <><
>   
Right, damn I missed that. Not too used to the whole "to_..." stuff.
I'll wait a little in case someone has other comments, and I'll resubmit
in a single patch (unless you really want me to separate in 4 patch, 2
of those
being one liners ...)


    Sylvain



More information about the Linuxppc-dev mailing list