lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Thu,  6 Oct 2016 14:29:50 +0200
From:   Robin van der Gracht <robin@...tonic.nl>
To:     Miguel Ojeda Sandonis <miguel.ojeda.sandonis@...il.com>
Cc:     linux-kernel@...r.kernel.org,
        Robin van der Gracht <robin@...tonic.nl>
Subject: [PATCH] auxdisplay: ht16k33: Use unique i2c client device name

Static naming causes problems when multiple devices are registered.

Signed-off-by: Robin van der Gracht <robin@...tonic.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ