mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-28 07:13:34 +00:00
backlight: hp680_bl: use devm_backlight_device_register()
Use devm_backlight_device_register() to make cleanup paths simpler. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
0ec585d320
commit
0561c1794a
1 changed files with 2 additions and 4 deletions
|
@ -110,8 +110,8 @@ static int hp680bl_probe(struct platform_device *pdev)
|
||||||
memset(&props, 0, sizeof(struct backlight_properties));
|
memset(&props, 0, sizeof(struct backlight_properties));
|
||||||
props.type = BACKLIGHT_RAW;
|
props.type = BACKLIGHT_RAW;
|
||||||
props.max_brightness = HP680_MAX_INTENSITY;
|
props.max_brightness = HP680_MAX_INTENSITY;
|
||||||
bd = backlight_device_register("hp680-bl", &pdev->dev, NULL,
|
bd = devm_backlight_device_register(&pdev->dev, "hp680-bl", &pdev->dev,
|
||||||
&hp680bl_ops, &props);
|
NULL, &hp680bl_ops, &props);
|
||||||
if (IS_ERR(bd))
|
if (IS_ERR(bd))
|
||||||
return PTR_ERR(bd);
|
return PTR_ERR(bd);
|
||||||
|
|
||||||
|
@ -131,8 +131,6 @@ static int hp680bl_remove(struct platform_device *pdev)
|
||||||
bd->props.power = 0;
|
bd->props.power = 0;
|
||||||
hp680bl_send_intensity(bd);
|
hp680bl_send_intensity(bd);
|
||||||
|
|
||||||
backlight_device_unregister(bd);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue