platform/x86: asus-wmi: Fix hwmon device cleanup
authorYurii Pavlovskyi <yurii.pavlovskyi@gmail.com>
Tue, 14 May 2019 18:50:30 +0000 (20:50 +0200)
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 17 Jun 2019 12:22:47 +0000 (15:22 +0300)
commitcd10ee006ab504b2b9c5ed992cc06d3e110c6311
treeffb775ec9399b1a2db36c880b974a3c0d2b4f3f1
parent2a5753559ed30461f0aade19290009973a15ce5a
platform/x86: asus-wmi: Fix hwmon device cleanup

The driver does not clean up the hwmon device on exit or error. To
reproduce the bug, repeat rmmod, insmod to verify that device number
/sys/devices/platform/asus-nb-wmi/hwmon/hwmon?? grows every time. Replace
call for registering device with devm_* version that unregisters it
automatically.

Signed-off-by: Yurii Pavlovskyi <yurii.pavlovskyi@gmail.com>
Reviewed-by: Daniel Drake <drake@endlessm.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
drivers/platform/x86/asus-wmi.c