Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

fbdev: sh_mobile_lcdc: checking NULL instead of IS_ERR()

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

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>

authored by

Dan Carpenter and committed by
Paul Mundt
beee1f20 e0998eab

+3 -2
+3 -2
drivers/video/sh_mobile_lcdcfb.c
··· 1088 1088 1089 1089 bl = backlight_device_register(ch->cfg.bl_info.name, parent, ch, 1090 1090 &sh_mobile_lcdc_bl_ops, NULL); 1091 - if (!bl) { 1092 - dev_err(parent, "unable to register backlight device\n"); 1091 + if (IS_ERR(bl)) { 1092 + dev_err(parent, "unable to register backlight device: %ld\n", 1093 + PTR_ERR(bl)); 1093 1094 return NULL; 1094 1095 } 1095 1096