]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
backlight_device_register() returns ERR_PTR() on error.
authorAxel Lin <axel.lin@gmail.com>
Tue, 26 Jul 2011 10:14:45 +0000 (20:14 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 29 Jul 2011 05:49:11 +0000 (15:49 +1000)
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: Jin Park <jinyoungp@nvidia.com>
Cc: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/video/backlight/aat2870_bl.c

index 4952a617563d102010070cf2e580079495f5fddb..f13a3f7e2e8fc251c8d598a4033f8439972ae031 100644 (file)
@@ -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;
        }