aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/backlight
diff options
context:
space:
mode:
authorJingoo Han <jg1.han@samsung.com>2012-07-30 17:40:31 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-07-30 20:25:14 -0400
commita4be29ac6df4f7c7a0225f7f72c78f4fb10114c0 (patch)
tree17fc7c823ce34f0a3d4a0cdca0924295dfb19d86 /drivers/video/backlight
parenta824c73cc33e149f79914bcebd90ace1433c0721 (diff)
drivers/video/backlight/atmel-pwm-bl.c: use devm_ functions
The devm_ functions allocate memory that is released when a driver detaches. This patch uses devm_kzalloc of these functions. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Acked-by: Hans-Christian Egtvedt <egtvedt@samfundet.no> Cc: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video/backlight')
-rw-r--r--drivers/video/backlight/atmel-pwm-bl.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/video/backlight/atmel-pwm-bl.c b/drivers/video/backlight/atmel-pwm-bl.c
index 0443a4f7185..cd64073d3f5 100644
--- a/drivers/video/backlight/atmel-pwm-bl.c
+++ b/drivers/video/backlight/atmel-pwm-bl.c
@@ -127,7 +127,8 @@ static int atmel_pwm_bl_probe(struct platform_device *pdev)
127 struct atmel_pwm_bl *pwmbl; 127 struct atmel_pwm_bl *pwmbl;
128 int retval; 128 int retval;
129 129
130 pwmbl = kzalloc(sizeof(struct atmel_pwm_bl), GFP_KERNEL); 130 pwmbl = devm_kzalloc(&pdev->dev, sizeof(struct atmel_pwm_bl),
131 GFP_KERNEL);
131 if (!pwmbl) 132 if (!pwmbl)
132 return -ENOMEM; 133 return -ENOMEM;
133 134
@@ -202,7 +203,6 @@ err_free_gpio:
202err_free_pwm: 203err_free_pwm:
203 pwm_channel_free(&pwmbl->pwmc); 204 pwm_channel_free(&pwmbl->pwmc);
204err_free_mem: 205err_free_mem:
205 kfree(pwmbl);
206 return retval; 206 return retval;
207} 207}
208 208
@@ -218,7 +218,6 @@ static int __exit atmel_pwm_bl_remove(struct platform_device *pdev)
218 pwm_channel_free(&pwmbl->pwmc); 218 pwm_channel_free(&pwmbl->pwmc);
219 backlight_device_unregister(pwmbl->bldev); 219 backlight_device_unregister(pwmbl->bldev);
220 platform_set_drvdata(pdev, NULL); 220 platform_set_drvdata(pdev, NULL);
221 kfree(pwmbl);
222 221
223 return 0; 222 return 0;
224} 223}