[PATCH 9/13] powerpc: Add arch/powerpc mv64x60 I2C platform data setup

Mark A. Greer mgreer at mvista.com
Thu Apr 26 10:43:02 EST 2007


On Thu, Apr 26, 2007 at 02:21:19AM +0200, Arnd Bergmann wrote:
> On Thursday 26 April 2007, Mark A. Greer wrote:
> > +static int __init mv64x60_i2c_platform_device_init(void)
> > +{
> > +       struct device_node *np = NULL;
> > +       int i;
> > +       struct platform_device *pdev;
> > +       int err;
> > +
> > +       for (i = 0;
> > +            (np = of_find_compatible_node(np, "i2c", "mv64x60-i2c"));
> 
> Same comment as about the ethernet driver: You should register an
> of_platform_driver from drivers/i2c/busses/i2c-mv64xxx.c.
> 
> Repeat after me: 
> 
> I will not call of_find_compatible_node() from device drivers.
> I will not call of_find_compatible_node() from device drivers.
> I will not call of_find_compatible_node() from device drivers.

Well, your comments are for Dale's patches so I'll leave it to him to
answer your questions in detail but...

of_find_compatible_node() is not being called from a driver, its being
called from platform code.  Its extracting info from the device tree and
setting up the platform_data required by the driver.

Mark



More information about the Linuxppc-dev mailing list