diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-07-26 23:26:27 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-07-26 23:26:27 -0400 |
commit | aa0b3b2bee1d3ca8355de76caebf65b836c9bb6e (patch) | |
tree | e1ba9eb2e96b55af1008162ec662b03ea24f9989 /drivers/leds/leds-gpio.c | |
parent | 6ee127b7dd63afe4d6d0a58293786bf4bf336850 (diff) | |
parent | d45bb11616c94c76c6e40960a120c0687b708a2e (diff) |
Merge branch 'for-3.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/linux-leds
Pull LED subsystem update from Bryan Wu.
* 'for-3.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/linux-leds: (50 commits)
leds-lp8788: forgotten unlock at lp8788_led_work
LEDS: propagate error codes in blinkm_detect()
LEDS: memory leak in blinkm_led_common_set()
leds: add new lp8788 led driver
LEDS: add BlinkM RGB LED driver, documentation and update MAINTAINERS
leds: max8997: Simplify max8997_led_set_mode implementation
leds/leds-s3c24xx: use devm_gpio_request
leds: convert Network Space v2 LED driver to devm_kzalloc() and cleanup error exit path
leds: convert DAC124S085 LED driver to devm_kzalloc()
leds: convert LM3530 LED driver to devm_kzalloc() and cleanup error exit path
leds: convert TCA6507 LED driver to devm_kzalloc()
leds: convert Freescale MC13783 LED driver to devm_kzalloc() and cleanup error exit path
leds: convert ADP5520 LED driver to devm_kzalloc() and cleanup error exit path
leds: convert PCA955x LED driver to devm_kzalloc() and cleanup error exit path
leds: convert Sun Fire LED driver to devm_kzalloc() and cleanup error exit path
leds: convert PCA9532 LED driver to devm_kzalloc()
leds: convert LT3593 LED driver to devm_kzalloc()
leds: convert Renesas TPU LED driver to devm_kzalloc() and cleanup error exit path
leds: convert LP5523 LED driver to devm_kzalloc() and cleanup error exit path
leds: convert PCA9633 LED driver to devm_kzalloc()
...
Diffstat (limited to 'drivers/leds/leds-gpio.c')
-rw-r--r-- | drivers/leds/leds-gpio.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c index f4c470a3bc8d..c032b2180340 100644 --- a/drivers/leds/leds-gpio.c +++ b/drivers/leds/leds-gpio.c | |||
@@ -178,7 +178,8 @@ static struct gpio_leds_priv * __devinit gpio_leds_create_of(struct platform_dev | |||
178 | if (!count) | 178 | if (!count) |
179 | return NULL; | 179 | return NULL; |
180 | 180 | ||
181 | priv = kzalloc(sizeof_gpio_leds_priv(count), GFP_KERNEL); | 181 | priv = devm_kzalloc(&pdev->dev, sizeof_gpio_leds_priv(count), |
182 | GFP_KERNEL); | ||
182 | if (!priv) | 183 | if (!priv) |
183 | return NULL; | 184 | return NULL; |
184 | 185 | ||
@@ -215,7 +216,6 @@ static struct gpio_leds_priv * __devinit gpio_leds_create_of(struct platform_dev | |||
215 | err: | 216 | err: |
216 | for (count = priv->num_leds - 2; count >= 0; count--) | 217 | for (count = priv->num_leds - 2; count >= 0; count--) |
217 | delete_gpio_led(&priv->leds[count]); | 218 | delete_gpio_led(&priv->leds[count]); |
218 | kfree(priv); | ||
219 | return NULL; | 219 | return NULL; |
220 | } | 220 | } |
221 | 221 | ||
@@ -239,8 +239,9 @@ static int __devinit gpio_led_probe(struct platform_device *pdev) | |||
239 | int i, ret = 0; | 239 | int i, ret = 0; |
240 | 240 | ||
241 | if (pdata && pdata->num_leds) { | 241 | if (pdata && pdata->num_leds) { |
242 | priv = kzalloc(sizeof_gpio_leds_priv(pdata->num_leds), | 242 | priv = devm_kzalloc(&pdev->dev, |
243 | GFP_KERNEL); | 243 | sizeof_gpio_leds_priv(pdata->num_leds), |
244 | GFP_KERNEL); | ||
244 | if (!priv) | 245 | if (!priv) |
245 | return -ENOMEM; | 246 | return -ENOMEM; |
246 | 247 | ||
@@ -253,7 +254,6 @@ static int __devinit gpio_led_probe(struct platform_device *pdev) | |||
253 | /* On failure: unwind the led creations */ | 254 | /* On failure: unwind the led creations */ |
254 | for (i = i - 1; i >= 0; i--) | 255 | for (i = i - 1; i >= 0; i--) |
255 | delete_gpio_led(&priv->leds[i]); | 256 | delete_gpio_led(&priv->leds[i]); |
256 | kfree(priv); | ||
257 | return ret; | 257 | return ret; |
258 | } | 258 | } |
259 | } | 259 | } |
@@ -277,7 +277,6 @@ static int __devexit gpio_led_remove(struct platform_device *pdev) | |||
277 | delete_gpio_led(&priv->leds[i]); | 277 | delete_gpio_led(&priv->leds[i]); |
278 | 278 | ||
279 | dev_set_drvdata(&pdev->dev, NULL); | 279 | dev_set_drvdata(&pdev->dev, NULL); |
280 | kfree(priv); | ||
281 | 280 | ||
282 | return 0; | 281 | return 0; |
283 | } | 282 | } |