Commit 4941b395 authored by David Brownell's avatar David Brownell Committed by Greg Kroah-Hartman

[PATCH] I2C: I2C controllers go into right place on sysfs

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: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 6af586dc
...@@ -426,10 +426,7 @@ static int i2cdev_attach_adapter(struct i2c_adapter *adap) ...@@ -426,10 +426,7 @@ static int i2cdev_attach_adapter(struct i2c_adapter *adap)
/* register this i2c device with the driver core */ /* register this i2c device with the driver core */
i2c_dev->adap = adap; i2c_dev->adap = adap;
if (adap->dev.parent == &platform_bus)
dev = &adap->dev; dev = &adap->dev;
else
dev = adap->dev.parent;
i2c_dev->class_dev = class_device_create(i2c_dev_class, NULL, i2c_dev->class_dev = class_device_create(i2c_dev_class, NULL,
MKDEV(I2C_MAJOR, i2c_dev->minor), MKDEV(I2C_MAJOR, i2c_dev->minor),
dev, "i2c-%d", i2c_dev->minor); dev, "i2c-%d", i2c_dev->minor);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment