Skip to contentSkip to conversation

mma8450: add parent device

PATCH Applied Stefan Sauer 2 participants 2 messages Feb 25, 2015 – Feb 26, 2015 Input drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mma8450: add parent device

Add the parent device so that udev can show the full hierarchy. This avoids the device showing up under /devices/virtual/input instead of the i2c bus it is actually attached to.

---
 drivers/input/misc/mma8450.c | 1 +
 1 file changed, 1 insertion(+)
drivers/input/misc/mma8450.c +1 -0
index 59d4dcd..9822877 100644
@@ -187,6 +187,7 @@ static int mma8450_probe(struct i2c_client *c,
 	idev->private		= m;
 	idev->input->name	= MMA8450_DRV_NAME;
 	idev->input->id.bustype	= BUS_I2C;
+	idev->input->dev.parent = &c->dev;
 	idev->poll		= mma8450_poll;
 	idev->poll_interval	= POLL_INTERVAL;
 	idev->poll_interval_max	= POLL_INTERVAL_MAX;
Signature · 1 line
2.2.0.rc0.207.ga3a616c
maintainer Applied
#1 lore raw
Quoted 5 lines · Stefan Sauer

Add the parent device so that udev can show the full hierarchy. This avoids the device showing up under /devices/virtual/input instead of the i2c bus it is actually attached to.

Applied, thank you.

Quoted 19 lines
---
 drivers/input/misc/mma8450.c | 1 +
 1 file changed, 1 insertion(+)
drivers/input/misc/mma8450.c +1 -0
index 59d4dcd..9822877 100644
@@ -187,6 +187,7 @@ static int mma8450_probe(struct i2c_client *c,
 	idev->private		= m;
 	idev->input->name	= MMA8450_DRV_NAME;
 	idev->input->id.bustype	= BUS_I2C;
+	idev->input->dev.parent = &c->dev;
 	idev->poll		= mma8450_poll;
 	idev->poll_interval	= POLL_INTERVAL;
 	idev->poll_interval_max	= POLL_INTERVAL_MAX;
Signature · 1 line
2.2.0.rc0.207.ga3a616c
Signature · 1 line
Dmitry