Title: [6198] trunk/drivers/input/keyboard: [#4375] ADP5520 Multifunction LCD Backlight and Keypad Input Device
Revision
6198
Author
hennerich
Date
2009-03-17 11:31:09 -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/input/keyboard/Kconfig (6197 => 6198)


--- trunk/drivers/input/keyboard/Kconfig	2009-03-17 14:29:54 UTC (rev 6197)
+++ trunk/drivers/input/keyboard/Kconfig	2009-03-17 16:31:09 UTC (rev 6198)
@@ -348,5 +348,6 @@
 	help
 	  This option enables support for the keypad scan matrix
 	  on Analog Devices ADP5520 PMICs.
-
+	  To compile this driver as a module, choose M here: the module will be
+	  called adp5520-keys.
 endif

Modified: trunk/drivers/input/keyboard/adp5520-keys.c (6197 => 6198)


--- trunk/drivers/input/keyboard/adp5520-keys.c	2009-03-17 14:29:54 UTC (rev 6197)
+++ trunk/drivers/input/keyboard/adp5520-keys.c	2009-03-17 16:31:09 UTC (rev 6198)
@@ -76,16 +76,20 @@
 	int ret, i;
 	unsigned char en_mask, ctl_mask = 0;
 
-	if (pdev->id != ID_ADP5520)
+	if (pdev->id != ID_ADP5520) {
+		dev_err(&pdev->dev, "only ADP5520 supports Keypad\n");
 		return -EFAULT;
+	}
 
-	if (pdata == NULL)
+	if (pdata == NULL) {
+		dev_err(&pdev->dev, "missing platform data\n");
 		return -ENODEV;
+	}
 
 	if (!(pdata->rows_en_mask && pdata->cols_en_mask))
 		return -ENODEV;
 
-	dev = kzalloc(sizeof(struct adp5520_keys), GFP_KERNEL);
+	dev = kzalloc(sizeof(*dev), GFP_KERNEL);
 	if (dev == NULL) {
 		dev_err(&pdev->dev, "failed to alloc memory\n");
 		return -ENOMEM;
@@ -93,8 +97,8 @@
 
 	input = input_allocate_device();
 	if (!input) {
-		kfree(dev);
-		return -ENOMEM;
+		ret = -ENOMEM;
+		goto err;
 	}
 
 	dev->master = pdev->dev.parent;
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
http://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits

Reply via email to