Commit 4941b395b3c2635a8c16d88791a789fb6ac6be43

Authored by David Brownell
Committed by Greg Kroah-Hartman
1 parent 6af586dc58

[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: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

Showing 1 changed file with 1 additions and 4 deletions Side-by-side Diff

drivers/i2c/i2c-dev.c
... ... @@ -426,10 +426,7 @@
426 426  
427 427 /* register this i2c device with the driver core */
428 428 i2c_dev->adap = adap;
429   - if (adap->dev.parent == &platform_bus)
430   - dev = &adap->dev;
431   - else
432   - dev = adap->dev.parent;
  429 + dev = &adap->dev;
433 430 i2c_dev->class_dev = class_device_create(i2c_dev_class, NULL,
434 431 MKDEV(I2C_MAJOR, i2c_dev->minor),
435 432 dev, "i2c-%d", i2c_dev->minor);