linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch v2] fbdev: sh_mobile_lcdc: checking NULL instead of IS_ERR()
@ 2011-03-21 15:03 Dan Carpenter
  2011-03-22  7:09 ` Paul Mundt
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2011-03-21 15:03 UTC (permalink / raw)
  To: linux-fbdev

backlight_device_register() returns an ERR_PTR.  It doesn't return NULL.

Signed-off-by: Dan Carpenter <error27@gmail.com>
---
V2:  print the error code as well.
This patch is againts linux-next, in case you missed that earlier.

diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c
index bf2629f..757665b 100644
--- a/drivers/video/sh_mobile_lcdcfb.c
+++ b/drivers/video/sh_mobile_lcdcfb.c
@@ -1088,8 +1088,9 @@ static struct backlight_device *sh_mobile_lcdc_bl_probe(struct device *parent,
 
 	bl = backlight_device_register(ch->cfg.bl_info.name, parent, ch,
 				       &sh_mobile_lcdc_bl_ops, NULL);
-	if (!bl) {
-		dev_err(parent, "unable to register backlight device\n");
+	if (IS_ERR(bl)) {
+		dev_err(parent, "unable to register backlight device: %ld\n",
+			PTR_ERR(bl));
 		return NULL;
 	}
 

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

* Re: [patch v2] fbdev: sh_mobile_lcdc: checking NULL instead of IS_ERR()
  2011-03-21 15:03 [patch v2] fbdev: sh_mobile_lcdc: checking NULL instead of IS_ERR() Dan Carpenter
@ 2011-03-22  7:09 ` Paul Mundt
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Mundt @ 2011-03-22  7:09 UTC (permalink / raw)
  To: linux-fbdev

On Mon, Mar 21, 2011 at 06:03:13PM +0300, Dan Carpenter wrote:
> backlight_device_register() returns an ERR_PTR.  It doesn't return NULL.
> 
> Signed-off-by: Dan Carpenter <error27@gmail.com>
> ---
> V2:  print the error code as well.
> This patch is againts linux-next, in case you missed that earlier.
> 
Applied, thanks.

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

end of thread, other threads:[~2011-03-22  7:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-21 15:03 [patch v2] fbdev: sh_mobile_lcdc: checking NULL instead of IS_ERR() Dan Carpenter
2011-03-22  7:09 ` Paul Mundt

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).