[PATCH 4/4] powerpc: Call of_register_i2c_devices() for fsl-i2c.

Kumar Gala galak at kernel.crashing.org
Fri Dec 8 06:39:15 EST 2006


On Dec 7, 2006, at 1:35 PM, Arnd Bergmann wrote:

> On Thursday 07 December 2006 18:35, Scott Wood wrote:
>> --- a/arch/powerpc/sysdev/fsl_soc.c
>> +++ b/arch/powerpc/sysdev/fsl_soc.c
>> @@ -345,6 +345,8 @@ static int __init fsl_i2c_of_init(void)
>>                                                      
>> fsl_i2c_platform_data));
>>                 if (ret)
>>                         goto unreg;
>> +
>> +               of_register_i2c_devices(np, i);
>>         }
>
> I get the impression that this fsl_i2c_of_init function is doing the
> probing in the opposite way it should. Instead of searching the
> whole device tree for type="i2c" devices to call
> platform_device_register_simple, can't you use of_platform_bus_probe
> to create the i2c device in the first place, and then have a
> of_platform_driver that calls of_register_i2c_devices() in its probe
> function?

Some of this is historic because of arch/ppc legacy.  We explicitly  
spec'd devices as platform devices.  At some point we will move to  
having the drivers be proper of_platform drivers instead of platform  
drivers.

- k



More information about the Linuxppc-dev mailing list