Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754940AbcJFMaI (ORCPT ); Thu, 6 Oct 2016 08:30:08 -0400 Received: from protonic.xs4all.nl ([83.163.252.89]:17059 "EHLO protonic.xs4all.nl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751937AbcJFMaB (ORCPT ); Thu, 6 Oct 2016 08:30:01 -0400 From: Robin van der Gracht To: Miguel Ojeda Sandonis Cc: linux-kernel@vger.kernel.org, Robin van der Gracht Subject: [PATCH] auxdisplay: ht16k33: Use unique i2c client device name Date: Thu, 6 Oct 2016 14:29:50 +0200 Message-Id: <1475756990-2197-1-git-send-email-robin@protonic.nl> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1747 Lines: 48 Static naming causes problems when multiple devices are registered. Signed-off-by: Robin van der Gracht --- 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