linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] auxdisplay: ht16k33: Use unique i2c client device name
@ 2016-10-06 12:29 Robin van der Gracht
  0 siblings, 0 replies; only message in thread
From: Robin van der Gracht @ 2016-10-06 12:29 UTC (permalink / raw)
  To: Miguel Ojeda Sandonis; +Cc: linux-kernel, Robin van der Gracht

Static naming causes problems when multiple devices are registered.

Signed-off-by: Robin van der Gracht <robin@protonic.nl>
---
 drivers/auxdisplay/ht16k33.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/auxdisplay/ht16k33.c b/drivers/auxdisplay/ht16k33.c
index eeb323f..9c09bbc 100644
--- a/drivers/auxdisplay/ht16k33.c
+++ b/drivers/auxdisplay/ht16k33.c
@@ -345,6 +345,7 @@ static int ht16k33_probe(struct i2c_client *client,
 	struct ht16k33_keypad *keypad;
 	struct ht16k33_fbdev *fbdev;
 	struct device_node *node = client->dev.of_node;
+	const char *dev_id = dev_name(&client->dev);
 
 	if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) {
 		dev_err(&client->dev, "i2c_check_functionality error\n");
@@ -365,7 +366,7 @@ static int ht16k33_probe(struct i2c_client *client,
 	fbdev = &priv->fbdev;
 	keypad = &priv->keypad;
 
-	priv->workqueue = create_singlethread_workqueue(DRIVER_NAME "-wq");
+	priv->workqueue = create_singlethread_workqueue(dev_id);
 	if (priv->workqueue == NULL)
 		return -ENOMEM;
 
@@ -422,7 +423,7 @@ static int ht16k33_probe(struct i2c_client *client,
 		goto err_fbdev_unregister;
 	}
 
-	keypad->dev->name = DRIVER_NAME"-keypad";
+	keypad->dev->name = dev_id;
 	keypad->dev->id.bustype = BUS_I2C;
 	keypad->dev->open = ht16k33_keypad_start;
 	keypad->dev->close = ht16k33_keypad_stop;
@@ -476,7 +477,7 @@ static int ht16k33_probe(struct i2c_client *client,
 	bl_props.type = BACKLIGHT_RAW;
 	bl_props.max_brightness = MAX_BRIGHTNESS;
 
-	bl = devm_backlight_device_register(&client->dev, DRIVER_NAME"-bl",
+	bl = devm_backlight_device_register(&client->dev, dev_id,
 					    &client->dev, priv,
 					    &ht16k33_bl_ops, &bl_props);
 	if (IS_ERR(bl)) {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-10-06 12:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-06 12:29 [PATCH] auxdisplay: ht16k33: Use unique i2c client device name Robin van der Gracht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).