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

backlight: lp8788_bl: Delete a check before backlight_device_unregister()

The backlight_device_unregister() function tests whether its argument
is NULL and then returns immediately. Thus the test around the call is
not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Acked-by: Jingoo Han <jingoohan1@gmail.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>

authored by

Markus Elfring and committed by
Lee Jones
85463d8e 047ffbb2

+1 -2
+1 -2
drivers/video/backlight/lp8788_bl.c
··· 221 221 { 222 222 struct backlight_device *bl_dev = bl->bl_dev; 223 223 224 - if (bl_dev) 225 - backlight_device_unregister(bl_dev); 224 + backlight_device_unregister(bl_dev); 226 225 } 227 226 228 227 static ssize_t lp8788_get_bl_ctl_mode(struct device *dev,