]> err.no Git - linux-2.6/commitdiff
backlight: add more information output to pwm_backlight
authorBen Dooks <ben-linux@fluff.org>
Tue, 5 Aug 2008 20:01:22 +0000 (13:01 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 5 Aug 2008 21:33:48 +0000 (14:33 -0700)
Make the error paths in the pwm_backlight driver more informative in the
probe path, especially for the times that it finds an error.

Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Cc: Richard Purdie <rpurdie@rpsys.net>
Acked-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/video/backlight/pwm_bl.c

index 6338d0e2fe0794f100e4d55c37dcb847dcf646c6..441e5a707d3717645fea467d3f00dd14874320c4 100644 (file)
@@ -68,8 +68,10 @@ static int pwm_backlight_probe(struct platform_device *pdev)
        struct pwm_bl_data *pb;
        int ret;
 
-       if (!data)
+       if (!data) {
+               dev_err(&pdev->dev, "failed to find platform data\n");
                return -EINVAL;
+       }
 
        if (data->init) {
                ret = data->init(&pdev->dev);
@@ -79,6 +81,7 @@ static int pwm_backlight_probe(struct platform_device *pdev)
 
        pb = kzalloc(sizeof(*pb), GFP_KERNEL);
        if (!pb) {
+               dev_err(&pdev->dev, "no memory for state\n");
                ret = -ENOMEM;
                goto err_alloc;
        }
@@ -91,7 +94,8 @@ static int pwm_backlight_probe(struct platform_device *pdev)
                dev_err(&pdev->dev, "unable to request PWM for backlight\n");
                ret = PTR_ERR(pb->pwm);
                goto err_pwm;
-       }
+       } else
+               dev_dbg(&pdev->dev, "got pwm for backlight\n");
 
        bl = backlight_device_register(pdev->name, &pdev->dev,
                        pb, &pwm_backlight_ops);