Skip to contentSkip to conversation

BACKLIGHT: Add more information output to pwm_backlight

PATCH Ben Dooks 2 participants 2 messages Jul 29, 2008 – Aug 1, 2008

Subsystems (2)
lore
Share & tools
lore

Ben Dooks

author
#0 lore raw

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 <[email protected]>
drivers/video/backlight/pwm_bl.c +6 -2
Index: linux-2.6.26-quilt4/drivers/video/backlight/pwm_bl.c
===================================================================
@@ -68,8 +68,10 @@ static int pwm_backlight_probe(struct pl
 	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 pl
 
 	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 pl
 		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);
Signature · 9 lines
Ben ([email protected], http://www.fluff.org/)

  'a smiley only costs 4 bytes'

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
#1 lore raw
Quoted 7 lines · On Tue, 29 Jul 2008 11:44:06 +0100 Ben Dooks <[email protected]> wrote:

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 <[email protected]>

----------------------------------------------------------------------
Najciekawsze miejsca w Polsce i na swiecie!
Zobacz >>> http://link.interia.pl/f1e60

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/