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:

committed by
Darren Hart

parent
a39f46df33
commit
0098181016
@@ -1154,8 +1154,7 @@ fail_hotkey1:
|
||||
fail_hotkey:
|
||||
platform_driver_unregister(&fujitsupf_driver);
|
||||
fail_backlight:
|
||||
if (fujitsu->bl_device)
|
||||
backlight_device_unregister(fujitsu->bl_device);
|
||||
backlight_device_unregister(fujitsu->bl_device);
|
||||
fail_sysfs_group:
|
||||
sysfs_remove_group(&fujitsu->pf_device->dev.kobj,
|
||||
&fujitsupf_attribute_group);
|
||||
@@ -1179,8 +1178,7 @@ static void __exit fujitsu_cleanup(void)
|
||||
|
||||
platform_driver_unregister(&fujitsupf_driver);
|
||||
|
||||
if (fujitsu->bl_device)
|
||||
backlight_device_unregister(fujitsu->bl_device);
|
||||
backlight_device_unregister(fujitsu->bl_device);
|
||||
|
||||
sysfs_remove_group(&fujitsu->pf_device->dev.kobj,
|
||||
&fujitsupf_attribute_group);
|
||||
|
Reference in New Issue
Block a user