Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 00981810 authored by Markus Elfring's avatar Markus Elfring Committed by Darren Hart
Browse files

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: default avatarMarkus Elfring <elfring@users.sourceforge.net>
For msi-wmi.c:
Acked-by: default avatarAnisse Astier <anisse@astier.eu>
Signed-off-by: default avatarDarren Hart <dvhart@linux.intel.com>
parent a39f46df
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -843,7 +843,6 @@ static int asus_backlight_init(struct asus_laptop *asus)

static void asus_backlight_exit(struct asus_laptop *asus)
{
	if (asus->backlight_device)
	backlight_device_unregister(asus->backlight_device);
	asus->backlight_device = NULL;
}
+1 −2
Original line number Diff line number Diff line
@@ -1308,7 +1308,6 @@ 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);

	asus->backlight_device = NULL;
+1 −2
Original line number Diff line number Diff line
@@ -1174,7 +1174,6 @@ static int eeepc_backlight_init(struct eeepc_laptop *eeepc)

static void eeepc_backlight_exit(struct eeepc_laptop *eeepc)
{
	if (eeepc->backlight_device)
	backlight_device_unregister(eeepc->backlight_device);
	eeepc->backlight_device = NULL;
}
+2 −4
Original line number Diff line number Diff line
@@ -1154,7 +1154,6 @@ static int __init fujitsu_init(void)
fail_hotkey:
	platform_driver_unregister(&fujitsupf_driver);
fail_backlight:
	if (fujitsu->bl_device)
	backlight_device_unregister(fujitsu->bl_device);
fail_sysfs_group:
	sysfs_remove_group(&fujitsu->pf_device->dev.kobj,
@@ -1179,7 +1178,6 @@ static void __exit fujitsu_cleanup(void)

	platform_driver_unregister(&fujitsupf_driver);

	if (fujitsu->bl_device)
	backlight_device_unregister(fujitsu->bl_device);

	sysfs_remove_group(&fujitsu->pf_device->dev.kobj,
+1 −2
Original line number Diff line number Diff line
@@ -729,7 +729,6 @@ static int ideapad_backlight_init(struct ideapad_private *priv)

static void ideapad_backlight_exit(struct ideapad_private *priv)
{
	if (priv->blightdev)
	backlight_device_unregister(priv->blightdev);
	priv->blightdev = NULL;
}
Loading