Commit de2efd2a authored by Jingoo Han's avatar Jingoo Han Committed by Linus Torvalds

backlight: generic_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>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 23741ada
......@@ -93,8 +93,8 @@ static int genericbl_probe(struct platform_device *pdev)
memset(&props, 0, sizeof(struct backlight_properties));
props.type = BACKLIGHT_RAW;
props.max_brightness = machinfo->max_intensity;
bd = backlight_device_register(name, &pdev->dev, NULL, &genericbl_ops,
&props);
bd = devm_backlight_device_register(&pdev->dev, name, &pdev->dev,
NULL, &genericbl_ops, &props);
if (IS_ERR(bd))
return PTR_ERR(bd);
......@@ -118,8 +118,6 @@ static int genericbl_remove(struct platform_device *pdev)
bd->props.brightness = 0;
backlight_update_status(bd);
backlight_device_unregister(bd);
dev_info(&pdev->dev, "Generic Backlight Driver Unloaded\n");
return 0;
}
......
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