platform/x86: fujitsu-laptop: allocate fujitsu_laptop in acpi_fujitsu_laptop_add()
authorMichał Kępień <kernel@kempniu.pl>
Fri, 19 May 2017 07:44:44 +0000 (09:44 +0200)
committerDarren Hart (VMware) <dvhart@infradead.org>
Sat, 3 Jun 2017 19:04:00 +0000 (12:04 -0700)
commita4b176ea9ab8b10d976dde61972ac884f888ba56
tree9f214b5c0a457ade1b414725a4ded9a7dfb7ca66
parentf2db7c646b716160dbb8832c24d47a35e9ac299a
platform/x86: fujitsu-laptop: allocate fujitsu_laptop in acpi_fujitsu_laptop_add()

Only allocate memory for struct fujitsu_laptop when the FUJ02E3 ACPI
device is present.  Use devm_kzalloc() for allocating memory to simplify
cleanup.

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