[PATCH] leds: start numerating duplicated devices from 2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Duplicated devices are currently given numerical suffixes
starting from 1. Since duplication means that one instance
of a device already exists in the system, then it is more
intuitive for the next device to get the suffix "_2".

Signed-off-by: Jacek Anaszewski <j.anaszewski@xxxxxxxxxxx>
Acked-by: Kyungmin Park <kyungmin.park@xxxxxxxxxxx>
Cc: Bryan Wu <cooloney@xxxxxxxxx>
Cc: Richard Purdie <rpurdie@xxxxxxxxx>
Cc: Ricardo Ribalda Delgado <ricardo.ribalda@xxxxxxxxx>
Cc: Sakari Ailus <sakari.ailus@xxxxxx>
---
 drivers/leds/led-class.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/leds/led-class.c b/drivers/leds/led-class.c
index 4ca37b8..d4973fd 100644
--- a/drivers/leds/led-class.c
+++ b/drivers/leds/led-class.c
@@ -222,7 +222,7 @@ static int match_name(struct device *dev, const void *data)
 static int led_classdev_next_name(const char *init_name, char *name,
 				  size_t len)
 {
-	int i = 0;
+	int i = 1;
 
 	strncpy(name, init_name, len);
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-leds" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux