From 14563a4ec450f35c70fbe5f6ac5199e9d5a0edc5 Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Tue, 5 Aug 2008 13:01:22 -0700 Subject: backlight: add more information output to pwm_backlight 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 Signed-off-by: Ben Dooks Cc: Richard Purdie Acked-by: Krzysztof Helt Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/video/backlight/pwm_bl.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c index 6338d0e2fe07..441e5a707d37 100644 --- a/drivers/video/backlight/pwm_bl.c +++ b/drivers/video/backlight/pwm_bl.c @@ -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); -- cgit v1.2.3