[PATCH] I2C: I2C controllers go into right place on sysfs
authorDavid Brownell <david-b@pacbell.net>
Tue, 13 Jun 2006 16:47:27 +0000 (09:47 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 22 Jun 2006 18:10:36 +0000 (11:10 -0700)
I2C creates some sysfs nodes in the wrong places:  not as children of parent
controllers, but as their peers (!).  This puts them into the right place
always, instead of just when the adapter is on the platform bus.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/i2c/i2c-dev.c

index ed7eed388bae32caec406b4daf335cab07ad9e38..58ccddd5c237dd5823140da8857691ed9780cc9f 100644 (file)
@@ -426,10 +426,7 @@ static int i2cdev_attach_adapter(struct i2c_adapter *adap)
 
        /* register this i2c device with the driver core */
        i2c_dev->adap = adap;
-       if (adap->dev.parent == &platform_bus)
-               dev = &adap->dev;
-       else
-               dev = adap->dev.parent;
+       dev = &adap->dev;
        i2c_dev->class_dev = class_device_create(i2c_dev_class, NULL,
                                                 MKDEV(I2C_MAJOR, i2c_dev->minor),
                                                 dev, "i2c-%d", i2c_dev->minor);