summaryrefslogtreecommitdiff
path: root/drivers/leds/leds-mc13783.c
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2012-08-01 13:49:13 +0900
committerPaul Mundt <lethal@linux-sh.org>2012-08-01 13:49:13 +0900
commit91ba548cfd5cc8ee93b9435527efb8fa4caf5c5e (patch)
treec96ed92413044a28d17783e84a8824bfd2437af1 /drivers/leds/leds-mc13783.c
parentb9ccfda293ee6fca9a89a1584f0900e0627b975e (diff)
parent4dc4c51675c137c30838425ecc8d471ff5eb138b (diff)
downloadlinux-3.10-91ba548cfd5cc8ee93b9435527efb8fa4caf5c5e.tar.gz
linux-3.10-91ba548cfd5cc8ee93b9435527efb8fa4caf5c5e.tar.bz2
linux-3.10-91ba548cfd5cc8ee93b9435527efb8fa4caf5c5e.zip
Merge branch 'sh/dmaengine' into sh-latest
Diffstat (limited to 'drivers/leds/leds-mc13783.c')
-rw-r--r--drivers/leds/leds-mc13783.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/leds/leds-mc13783.c b/drivers/leds/leds-mc13783.c
index 4cc6a2e3df3..2a5d4340067 100644
--- a/drivers/leds/leds-mc13783.c
+++ b/drivers/leds/leds-mc13783.c
@@ -280,7 +280,8 @@ static int __devinit mc13783_led_probe(struct platform_device *pdev)
return -EINVAL;
}
- led = kcalloc(pdata->num_leds, sizeof(*led), GFP_KERNEL);
+ led = devm_kzalloc(&pdev->dev, pdata->num_leds * sizeof(*led),
+ GFP_KERNEL);
if (led == NULL) {
dev_err(&pdev->dev, "failed to alloc memory\n");
return -ENOMEM;
@@ -289,7 +290,7 @@ static int __devinit mc13783_led_probe(struct platform_device *pdev)
ret = mc13783_leds_prepare(pdev);
if (ret) {
dev_err(&pdev->dev, "unable to init led driver\n");
- goto err_free;
+ return ret;
}
for (i = 0; i < pdata->num_leds; i++) {
@@ -344,8 +345,6 @@ err_register:
cancel_work_sync(&led[i].work);
}
-err_free:
- kfree(led);
return ret;
}
@@ -372,7 +371,7 @@ static int __devexit mc13783_led_remove(struct platform_device *pdev)
mc13xxx_unlock(dev);
- kfree(led);
+ platform_set_drvdata(pdev, NULL);
return 0;
}