Skip to contentSkip to conversation

fbdev: sh_mobile_lcdc: checking NULL instead of IS_ERR()

PATCH Applied Dan Carpenter 2 participants 2 messages Mar 21, 2011 – Mar 22, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 fbdev: sh_mobile_lcdc: checking NULL instead of IS_ERR()

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

---
V2: print the error code as well.
This patch is againts linux-next, in case you missed that earlier.

drivers/video/sh_mobile_lcdcfb.c +3 -2
index bf2629f..757665b 100644
@@ -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;
 	}
 
Applied
#1 lore raw
Quoted 7 lines · Dan Carpenter

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

---
V2: print the error code as well.
This patch is againts linux-next, in case you missed that earlier.

Applied, thanks.