]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
staging: olpc_dcon: Deletion of a check before backlight_device_unregister()
authorMarkus Elfring <elfring@users.sourceforge.net>
Mon, 24 Nov 2014 21:58:48 +0000 (22:58 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Nov 2014 22:00:22 +0000 (14:00 -0800)
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/olpc_dcon/olpc_dcon.c

index eb83b28b8cd16927f168faf305a54e9ebdf627dc..6a9a8815477cdd4f469c4c5fddcfa42dd4a801ce 100644 (file)
@@ -682,8 +682,7 @@ static int dcon_remove(struct i2c_client *client)
 
        free_irq(DCON_IRQ, dcon);
 
-       if (dcon->bl_dev)
-               backlight_device_unregister(dcon->bl_dev);
+       backlight_device_unregister(dcon->bl_dev);
 
        if (dcon_device != NULL)
                platform_device_unregister(dcon_device);