Commit 443956fd authored by Jingoo Han's avatar Jingoo Han Committed by Linus Torvalds

backlight: ot200_bl: use devm_backlight_device_register()

Use devm_backlight_device_register() to make cleanup paths simpler.
Signed-off-by: default avatarJingoo Han <jg1.han@samsung.com>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent c76d1022
...@@ -118,8 +118,9 @@ static int ot200_backlight_probe(struct platform_device *pdev) ...@@ -118,8 +118,9 @@ static int ot200_backlight_probe(struct platform_device *pdev)
props.brightness = 100; props.brightness = 100;
props.type = BACKLIGHT_RAW; props.type = BACKLIGHT_RAW;
bl = backlight_device_register(dev_name(&pdev->dev), &pdev->dev, data, bl = devm_backlight_device_register(&pdev->dev, dev_name(&pdev->dev),
&ot200_backlight_ops, &props); &pdev->dev, data, &ot200_backlight_ops,
&props);
if (IS_ERR(bl)) { if (IS_ERR(bl)) {
dev_err(&pdev->dev, "failed to register backlight\n"); dev_err(&pdev->dev, "failed to register backlight\n");
retval = PTR_ERR(bl); retval = PTR_ERR(bl);
...@@ -137,10 +138,6 @@ static int ot200_backlight_probe(struct platform_device *pdev) ...@@ -137,10 +138,6 @@ static int ot200_backlight_probe(struct platform_device *pdev)
static int ot200_backlight_remove(struct platform_device *pdev) static int ot200_backlight_remove(struct platform_device *pdev)
{ {
struct backlight_device *bl = platform_get_drvdata(pdev);
backlight_device_unregister(bl);
/* on module unload set brightness to 100% */ /* on module unload set brightness to 100% */
cs5535_mfgpt_write(pwm_timer, MFGPT_REG_COUNTER, 0); cs5535_mfgpt_write(pwm_timer, MFGPT_REG_COUNTER, 0);
cs5535_mfgpt_write(pwm_timer, MFGPT_REG_SETUP, MFGPT_SETUP_CNTEN); cs5535_mfgpt_write(pwm_timer, MFGPT_REG_SETUP, MFGPT_SETUP_CNTEN);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment