Title: [6197] trunk/drivers/leds: [#4375] ADP5520 Multifunction LCD Backlight and Keypad Input Device
Revision
6197
Author
hennerich
Date
2009-03-17 09:29:54 -0500 (Tue, 17 Mar 2009)

Log Message

[#4375] ADP5520 Multifunction LCD Backlight and Keypad Input Device
Driver
Fixups per Mike's suggestions

Modified Paths

Diff

Modified: trunk/drivers/leds/Kconfig (6196 => 6197)


--- trunk/drivers/leds/Kconfig	2009-03-17 14:20:45 UTC (rev 6196)
+++ trunk/drivers/leds/Kconfig	2009-03-17 14:29:54 UTC (rev 6197)
@@ -171,6 +171,8 @@
 	help
 	  This option enables support for on-chip LED drivers found
 	  on Analog Devices ADP5520/ADP5501 PMICs.
+	  To compile this driver as a module, choose M here: the module will be
+	  called leds-adp5520.
 
 comment "LED Triggers"
 

Modified: trunk/drivers/leds/leds-adp5520.c (6196 => 6197)


--- trunk/drivers/leds/leds-adp5520.c	2009-03-17 14:20:45 UTC (rev 6196)
+++ trunk/drivers/leds/leds-adp5520.c	2009-03-17 14:29:54 UTC (rev 6197)
@@ -99,16 +99,18 @@
 	struct led_info *cur_led;
 	int ret, i;
 
-	if (pdata == NULL)
-		return 0;
+	if (pdata == NULL) {
+		dev_err(&pdev->dev, "missing platform data\n");
+		return -ENODEV;
+	}
 
 	if (pdata->num_leds > ADP5520_01_MAXLEDS) {
 		dev_err(&pdev->dev, "can't handle more than %d LEDS\n",
 				 ADP5520_01_MAXLEDS);
-		pdata->num_leds = ADP5520_01_MAXLEDS;
+		return -EFAULT;
 	}
 
-	led = kzalloc(sizeof(struct adp5520_led) * pdata->num_leds, GFP_KERNEL);
+	led = kzalloc(sizeof(*led) * pdata->num_leds, GFP_KERNEL);
 	if (led == NULL) {
 		dev_err(&pdev->dev, "failed to alloc memory\n");
 		return -ENOMEM;
@@ -152,6 +154,7 @@
 		ret = adp5520_led_setup(led_dat);
 		if (ret) {
 			dev_err(&pdev->dev, "failed to write\n");
+			i++;
 			goto err;
 		}
 	}
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
http://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits

Reply via email to