diff options
author | 2019-04-18 12:58:20 -0700 | |
---|---|---|
committer | 2019-05-14 07:00:47 -0700 | |
commit | 37bcec5d9f71bd13142a97d2196b293c9ac23823 (patch) | |
tree | 0350c5a1d8edcee93c0e48b8d204d361d7547300 /drivers/net/ethernet/mellanox/mlx5/core/vport.c | |
parent | hwmon: (npcm750-pwm-fan) Use devm_thermal_of_cooling_device_register (diff) | |
download | linux-stable-37bcec5d9f71bd13142a97d2196b293c9ac23823.tar.xz linux-stable-37bcec5d9f71bd13142a97d2196b293c9ac23823.zip |
hwmon: (pwm-fan) Use devm_thermal_of_cooling_device_register
Use devm_thermal_of_cooling_device_register() to register the cooling
device. Also use devm_add_action_or_reset() to stop the fan on device
removal, and to disable the pwm. Introduce a local 'dev' variable in
the probe function to make the code easier to read.
As a side effect, this fixes a bug seen if pwm_fan_of_get_cooling_data()
returned an error. In that situation, the pwm was not disabled, and
the fan was not stopped. Using devm functions also ensures that the
pwm is disabled and that the fan is stopped only after the hwmon device
has been unregistered.
Cc: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx5/core/vport.c')
0 files changed, 0 insertions, 0 deletions