diff options
author | Bryan Wu <bryan.wu@canonical.com> | 2012-07-04 06:27:40 +0200 |
---|---|---|
committer | Bryan Wu <bryan.wu@canonical.com> | 2012-07-24 01:52:40 +0200 |
commit | e58603122ee05f9bcfa07a33492d986dd5841a9c (patch) | |
tree | 53f96c3846f9a70dae5ed6224b9e494d999d4a20 /drivers/leds | |
parent | leds: convert LM3530 LED driver to devm_kzalloc() and cleanup error exit path (diff) | |
download | linux-e58603122ee05f9bcfa07a33492d986dd5841a9c.tar.xz linux-e58603122ee05f9bcfa07a33492d986dd5841a9c.zip |
leds: convert DAC124S085 LED driver to devm_kzalloc()
Cc: Guennadi Liakhovetski <lg@denx.de>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
Diffstat (limited to 'drivers/leds')
-rw-r--r-- | drivers/leds/leds-dac124s085.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/leds/leds-dac124s085.c b/drivers/leds/leds-dac124s085.c index d56c14269ff0..1f9d8e62d37e 100644 --- a/drivers/leds/leds-dac124s085.c +++ b/drivers/leds/leds-dac124s085.c @@ -69,7 +69,7 @@ static int dac124s085_probe(struct spi_device *spi) struct dac124s085_led *led; int i, ret; - dac = kzalloc(sizeof(*dac), GFP_KERNEL); + dac = devm_kzalloc(&spi->dev, sizeof(*dac), GFP_KERNEL); if (!dac) return -ENOMEM; @@ -102,7 +102,6 @@ eledcr: led_classdev_unregister(&dac->leds[i].ldev); spi_set_drvdata(spi, NULL); - kfree(dac); return ret; } @@ -117,7 +116,6 @@ static int dac124s085_remove(struct spi_device *spi) } spi_set_drvdata(spi, NULL); - kfree(dac); return 0; } |