diff options
author | Paul Mundt <lethal@linux-sh.org> | 2012-08-01 13:49:13 +0900 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2012-08-01 13:49:13 +0900 |
commit | 91ba548cfd5cc8ee93b9435527efb8fa4caf5c5e (patch) | |
tree | c96ed92413044a28d17783e84a8824bfd2437af1 /drivers/leds/leds-mc13783.c | |
parent | b9ccfda293ee6fca9a89a1584f0900e0627b975e (diff) | |
parent | 4dc4c51675c137c30838425ecc8d471ff5eb138b (diff) | |
download | linux-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.c | 9 |
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; } |