linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* BACKLIGHT: Add more information output to pwm_backlight
@ 2008-07-29 10:44 Ben Dooks
  2008-08-01 20:50 ` Krzysztof Helt
  0 siblings, 1 reply; 2+ messages in thread
From: Ben Dooks @ 2008-07-29 10:44 UTC (permalink / raw)
  To: akpm, linux-fbdev-devel; +Cc: Ben Dooks, Russell King

[-- Attachment #1: simtec/simtec-drivers-backlight-pwm-updates.patch --]
[-- Type: text/plain, Size: 1776 bytes --]

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>

Index: linux-2.6.26-quilt4/drivers/video/backlight/pwm_bl.c
===================================================================
--- linux-2.6.26-quilt4.orig/drivers/video/backlight/pwm_bl.c	2008-07-29 11:28:01.000000000 +0100
+++ linux-2.6.26-quilt4/drivers/video/backlight/pwm_bl.c	2008-07-29 11:36:02.000000000 +0100
@@ -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);

-- 
Ben (ben@fluff.org, 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=/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-08-01 20:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-29 10:44 BACKLIGHT: Add more information output to pwm_backlight Ben Dooks
2008-08-01 20:50 ` Krzysztof Helt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).