9
0
Fork 0

mfd stmpe: add index to devicename

Otherwise it's not possible to register multiple stmpe devices.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Sascha Hauer 2012-11-29 16:55:34 +01:00
parent 159109f5ff
commit 358434bbdd
1 changed files with 2 additions and 1 deletions

View File

@ -118,7 +118,8 @@ static int stmpe_probe(struct device_d *dev)
}
stmpe_dev = xzalloc(sizeof(struct stmpe));
stmpe_dev->cdev.name = DRIVERNAME;
stmpe_dev->cdev.name = asprintf(DRIVERNAME "%d",
cdev_find_free_index(DRIVERNAME));
stmpe_dev->client = to_i2c_client(dev);
stmpe_dev->cdev.size = 191; /* 191 known registers */
stmpe_dev->cdev.dev = dev;