lkml.org 
[lkml]   [2007]   [Jan]   [15]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
DateMon, 15 Jan 2007 12:26:54 +0000
FromBen Dooks <>
SubjectLEDS: S3C24XX generate name if none given
Generate a name if none is passed to the S3C24XX GPIO LED driver.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>

diff -urpN -X ../dontdiff linux-2.6.19/drivers/leds/leds-s3c24xx.c linux-2.6.19-simtec1p22/drivers/leds/leds-s3c24xx.c
--- linux-2.6.19/drivers/leds/leds-s3c24xx.c	2006-11-29 21:57:37.000000000 +0000
+++ linux-2.6.19-simtec1p22/drivers/leds/leds-s3c24xx.c	2007-01-04 10:22:58.000000000 +0000
@@ -23,6 +23,8 @@
 /* our context */
 
 struct s3c24xx_gpio_led {
+	char				 name[32];
+
 	struct led_classdev		 cdev;
 	struct s3c24xx_led_platdata	*pdata;
 };
@@ -85,6 +87,14 @@ static int s3c24xx_led_probe(struct plat
 
 	led->pdata = pdata;
 
+	/* create name if we where not passed one */
+
+	if (led->cdev.name == NULL) {
+		snprintf(led->name, sizeof(led->name), "%s.%d",
+			 dev->name, dev->id);
+		led->cdev.name = led->name;
+	}
+
 	/* no point in having a pull-up if we are always driving */
 
 	if (pdata->flags & S3C24XX_LEDF_TRISTATE) {
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2007-01-15 14:15    [from the cache]
©2003-2008