Skip to content

Commit d1c7073

Browse files
kempniudvhart
authored andcommitted
platform/x86: fujitsu-laptop: simplify error handling in acpi_fujitsu_laptop_add()
As LED class devices registered by fujitsu-laptop no longer depend on the platform device, two function calls inside acpi_fujitsu_laptop_add() can be rearranged in order to simplify error handling. Signed-off-by: Michał Kępień <[email protected]> Reviewed-by: Jonathan Woithe <[email protected]> Signed-off-by: Darren Hart (VMware) <[email protected]>
1 parent 30943e1 commit d1c7073

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

drivers/platform/x86/fujitsu-laptop.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -845,18 +845,16 @@ static int acpi_fujitsu_laptop_add(struct acpi_device *device)
845845
fujitsu_bl->bl_device->props.power = FB_BLANK_UNBLANK;
846846
}
847847

848-
error = fujitsu_laptop_platform_add();
848+
error = acpi_fujitsu_laptop_leds_register(device);
849849
if (error)
850850
goto err_free_fifo;
851851

852-
error = acpi_fujitsu_laptop_leds_register(device);
852+
error = fujitsu_laptop_platform_add();
853853
if (error)
854-
goto err_remove_platform_device;
854+
goto err_free_fifo;
855855

856856
return 0;
857857

858-
err_remove_platform_device:
859-
fujitsu_laptop_platform_remove();
860858
err_free_fifo:
861859
kfifo_free(&fujitsu_laptop->fifo);
862860
err_stop:

0 commit comments

Comments
 (0)