summaryrefslogtreecommitdiff
path: root/drivers/video/backlight/backlight.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/backlight/backlight.c')
-rw-r--r--drivers/video/backlight/backlight.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c
index c757faa604ca..1a4ef77677ed 100644
--- a/drivers/video/backlight/backlight.c
+++ b/drivers/video/backlight/backlight.c
@@ -305,9 +305,19 @@ struct backlight_device *backlight_device_register(const char *name,
{
struct backlight_device *new_bd;
int rc;
+ static int bk_id;
+ char tmp_name[64];
+ int i = 0;
+ char *p = NULL;
pr_debug("backlight_device_register: name=%s\n", name);
+ memset(tmp_name , 0x00, sizeof(tmp_name));
+ p = strchr(name, '.');
+ i = p - name;
+ strncpy(tmp_name, name, i);
+ sprintf(tmp_name, "%s.%d", tmp_name, bk_id++);
+
new_bd = kzalloc(sizeof(struct backlight_device), GFP_KERNEL);
if (!new_bd)
return ERR_PTR(-ENOMEM);
@@ -318,7 +328,7 @@ struct backlight_device *backlight_device_register(const char *name,
new_bd->dev.class = backlight_class;
new_bd->dev.parent = parent;
new_bd->dev.release = bl_device_release;
- dev_set_name(&new_bd->dev, name);
+ dev_set_name(&new_bd->dev, tmp_name);
dev_set_drvdata(&new_bd->dev, devdata);
/* Set default properties */