hwmon: (npcm750-pwm-fan) Use devm_thermal_of_cooling_device_register
authorGuenter Roeck <linux@roeck-us.net>
Thu, 18 Apr 2019 19:58:19 +0000 (12:58 -0700)
committerEduardo Valentin <edubezval@gmail.com>
Tue, 14 May 2019 14:00:46 +0000 (07:00 -0700)
commit0b2a785db8797db08181f71395a412c8eedbc614
treeaf211149d17dcd08ac88fd657226146c1c92928c
parent9ebe010e566e9300bf3a7bb4ebfeb3f4deb72aa6
hwmon: (npcm750-pwm-fan) Use devm_thermal_of_cooling_device_register

Use devm_thermal_of_cooling_device_register() to register the cooling
device. As a side effect, this fixes a driver bug:
thermal_cooling_device_unregister() was not called on device removal.

Fixes: f1fd4a4db777 ("hwmon: Add NPCM7xx PWM and Fan driver")
Cc: Tomer Maimon <tmaimon77@gmail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
drivers/hwmon/npcm750-pwm-fan.c