summaryrefslogtreecommitdiffstats
path: root/drivers/leds/leds-88pm860x.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2010-06-08 20:40:08 +0200
committerRussell King <rmk+kernel@arm.linux.org.uk>2010-06-08 20:40:08 +0200
commit76962be8491b18ae7ff4fd6a4accd398bdb402a2 (patch)
tree976958bf8e4989a69901bfbb25dd6463728c6cb5 /drivers/leds/leds-88pm860x.c
parentARM: 6166/1: Proper prefetch abort handling on pre-ARMv6 (diff)
parent[ARM] pxa/spitz: Correctly register WM8750 (diff)
downloadlinux-76962be8491b18ae7ff4fd6a4accd398bdb402a2.tar.xz
linux-76962be8491b18ae7ff4fd6a4accd398bdb402a2.zip
Merge branch 'fix' of git://git.kernel.org/pub/scm/linux/kernel/git/ycmiao/pxa-linux-2.6
Diffstat (limited to 'drivers/leds/leds-88pm860x.c')
-rw-r--r--drivers/leds/leds-88pm860x.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/leds/leds-88pm860x.c b/drivers/leds/leds-88pm860x.c
index 16a60c06c96c..b7677106cff8 100644
--- a/drivers/leds/leds-88pm860x.c
+++ b/drivers/leds/leds-88pm860x.c
@@ -256,8 +256,10 @@ static int pm860x_led_probe(struct platform_device *pdev)
if (pdev->dev.parent->platform_data) {
pm860x_pdata = pdev->dev.parent->platform_data;
pdata = pm860x_pdata->led;
- } else
- pdata = NULL;
+ } else {
+ dev_err(&pdev->dev, "missing platform data\n");
+ return -EINVAL;
+ }
data = kzalloc(sizeof(struct pm860x_led), GFP_KERNEL);
if (data == NULL)
@@ -268,8 +270,11 @@ static int pm860x_led_probe(struct platform_device *pdev)
data->i2c = (chip->id == CHIP_PM8606) ? chip->client : chip->companion;
data->iset = pdata->iset;
data->port = __check_device(pdata, data->name);
- if (data->port < 0)
+ if (data->port < 0) {
+ dev_err(&pdev->dev, "check device failed\n");
+ kfree(data);
return -EINVAL;
+ }
data->current_brightness = 0;
data->cdev.name = data->name;