platform/x86: fujitsu-laptop: refactor LED registration
authorMichał Kępień <kernel@kempniu.pl>
Fri, 7 Apr 2017 13:07:09 +0000 (15:07 +0200)
committerDarren Hart (VMware) <dvhart@infradead.org>
Wed, 19 Apr 2017 19:57:07 +0000 (12:57 -0700)
commit7adb7b129ac0359b49a8406376a5aee8ce754b97
tree47d62f4a3d16272a2710ee7093c0d0a4412670ef
parentd89bcc83e7090ac09c3f9712d9b9db9f1f1d8189
platform/x86: fujitsu-laptop: refactor LED registration

Move a long section of code responsible for registering LEDs out of
acpi_fujitsu_laptop_add() to improve readability and ensure proper
cleanup of platform device and kfifo e.g. when two supported LEDs are
detected, the first one gets registered successfully but the second one
does not.  This makes the result variable in acpi_fujitsu_laptop_add()
redundant, so remove it.  Adjust whitespace to make checkpatch happy.

Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Reviewed-by: Jonathan Woithe <jwoithe@just42.net>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
drivers/platform/x86/fujitsu-laptop.c