platform: x86: Deletion of checks 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>
For msi-wmi.c:
Acked-by: Anisse Astier <anisse@astier.eu>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
This commit is contained in:
Markus Elfring
2014-11-24 20:30:29 +01:00
committed by Darren Hart
parent a39f46df33
commit 0098181016
9 changed files with 10 additions and 20 deletions

View File

@@ -1308,8 +1308,7 @@ static int asus_wmi_backlight_init(struct asus_wmi *asus)
static void asus_wmi_backlight_exit(struct asus_wmi *asus)
{
if (asus->backlight_device)
backlight_device_unregister(asus->backlight_device);
backlight_device_unregister(asus->backlight_device);
asus->backlight_device = NULL;
}