Skip to content

Commit

Permalink
drivers/video/backlight/aat2870_bl.c: fix error checking for backligh…
Browse files Browse the repository at this point in the history
…t_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]>
  • Loading branch information
AxelLin authored and torvalds committed Aug 4, 2011
1 parent 1646ec9 commit 4c4dd90
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/video/backlight/aat2870_bl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 4c4dd90

Please sign in to comment.