diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2022-08-08 09:06:40 +0300 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2022-09-26 00:22:11 +0300 |
commit | 0dee25ebc7d315d9ee785ea5f457ae980979ea89 (patch) | |
tree | fb17f3248a9088a465185f25ea5aaaac9d4bf490 /drivers/hwmon/axi-fan-control.c | |
parent | 903882c767051a17c1535b2a820e2931ee44b8fb (diff) | |
download | linux-0dee25ebc7d315d9ee785ea5f457ae980979ea89.tar.xz |
hwmon: Make use of devm_clk_get_enabled()
Several drivers manually register a devm handler to disable their clk.
Convert them to devm_clk_get_enabled().
Acked-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon/axi-fan-control.c')
-rw-r--r-- | drivers/hwmon/axi-fan-control.c | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/drivers/hwmon/axi-fan-control.c b/drivers/hwmon/axi-fan-control.c index 96c4a5c45291..6724e0dd3088 100644 --- a/drivers/hwmon/axi-fan-control.c +++ b/drivers/hwmon/axi-fan-control.c @@ -394,11 +394,6 @@ static int axi_fan_control_init(struct axi_fan_control_data *ctl, return ret; } -static void axi_fan_control_clk_disable(void *clk) -{ - clk_disable_unprepare(clk); -} - static const struct hwmon_channel_info *axi_fan_control_info[] = { HWMON_CHANNEL_INFO(pwm, HWMON_PWM_INPUT), HWMON_CHANNEL_INFO(fan, HWMON_F_INPUT | HWMON_F_FAULT | HWMON_F_LABEL), @@ -478,20 +473,12 @@ static int axi_fan_control_probe(struct platform_device *pdev) if (IS_ERR(ctl->base)) return PTR_ERR(ctl->base); - clk = devm_clk_get(&pdev->dev, NULL); + clk = devm_clk_get_enabled(&pdev->dev, NULL); if (IS_ERR(clk)) { dev_err(&pdev->dev, "clk_get failed with %ld\n", PTR_ERR(clk)); return PTR_ERR(clk); } - ret = clk_prepare_enable(clk); - if (ret) - return ret; - - ret = devm_add_action_or_reset(&pdev->dev, axi_fan_control_clk_disable, clk); - if (ret) - return ret; - ctl->clk_rate = clk_get_rate(clk); if (!ctl->clk_rate) return -EINVAL; |