mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
drivers/video/backlight/aat2870_bl.c: fix error checking for backlight_device_register
backlight_device_register() returns ERR_PTR() on error. Signed-off-by: Axel Lin <[email protected]> Cc: Richard Purdie <[email protected]> Cc: Jin Park <[email protected]> Cc: Samuel Ortiz <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
1646ec9db7
commit
4c4dd903e7
1 changed files with 2 additions and 2 deletions
|
|
@ -158,10 +158,10 @@ static int aat2870_bl_probe(struct platform_device *pdev)
|
|||
props.type = BACKLIGHT_RAW;
|
||||
bd = backlight_device_register("aat2870-backlight", &pdev->dev,
|
||||
aat2870_bl, &aat2870_bl_ops, &props);
|
||||
if (!bd) {
|
||||
if (IS_ERR(bd)) {
|
||||
dev_err(&pdev->dev,
|
||||
"Failed allocate memory for backlight device\n");
|
||||
ret = -ENOMEM;
|
||||
ret = PTR_ERR(bd);
|
||||
goto out_kfree;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue