mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/2] mfd stmpe: add index to devicename
@ 2012-11-29 19:02 Sascha Hauer
  2012-11-29 19:02 ` [PATCH 2/2] mfd stmpe: fix test for features Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Sascha Hauer @ 2012-11-29 19:02 UTC (permalink / raw)
  To: barebox

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

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/mfd/stmpe-i2c.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/mfd/stmpe-i2c.c b/drivers/mfd/stmpe-i2c.c
index d7c29cc..7d16842 100644
--- a/drivers/mfd/stmpe-i2c.c
+++ b/drivers/mfd/stmpe-i2c.c
@@ -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;
-- 
1.7.10.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH 2/2] mfd stmpe: fix test for features
  2012-11-29 19:02 [PATCH 1/2] mfd stmpe: add index to devicename Sascha Hauer
@ 2012-11-29 19:02 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2012-11-29 19:02 UTC (permalink / raw)
  To: barebox

Use '&' to test for the bit as it was intended.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/mfd/stmpe-i2c.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mfd/stmpe-i2c.c b/drivers/mfd/stmpe-i2c.c
index 7d16842..9e4bbcc 100644
--- a/drivers/mfd/stmpe-i2c.c
+++ b/drivers/mfd/stmpe-i2c.c
@@ -132,7 +132,7 @@ static int stmpe_probe(struct device_d *dev)
 	i2c_ci->read_reg = stmpe_reg_read;
 	i2c_ci->write_reg = stmpe_reg_write;
 
-	if (pdata->blocks &= STMPE_BLOCK_GPIO)
+	if (pdata->blocks & STMPE_BLOCK_GPIO)
 		add_generic_device("stmpe-gpio", DEVICE_ID_DYNAMIC, NULL, 0, 0, IORESOURCE_MEM, i2c_ci);
 
 	devfs_create(&stmpe_dev->cdev);
-- 
1.7.10.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-11-29 19:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-29 19:02 [PATCH 1/2] mfd stmpe: add index to devicename Sascha Hauer
2012-11-29 19:02 ` [PATCH 2/2] mfd stmpe: fix test for features Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox