diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2022-08-08 08:06:40 +0200 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2022-09-25 14:22:11 -0700 |
commit | 0dee25ebc7d315d9ee785ea5f457ae980979ea89 (patch) | |
tree | fb17f3248a9088a465185f25ea5aaaac9d4bf490 /drivers/hwmon/mr75203.c | |
parent | 903882c767051a17c1535b2a820e2931ee44b8fb (diff) | |
download | lwn-0dee25ebc7d315d9ee785ea5f457ae980979ea89.tar.gz lwn-0dee25ebc7d315d9ee785ea5f457ae980979ea89.zip |
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/mr75203.c')
-rw-r--r-- | drivers/hwmon/mr75203.c | 26 |
1 files changed, 1 insertions, 25 deletions
diff --git a/drivers/hwmon/mr75203.c b/drivers/hwmon/mr75203.c index 01f63dc1a250..394a4c7e46ab 100644 --- a/drivers/hwmon/mr75203.c +++ b/drivers/hwmon/mr75203.c @@ -610,24 +610,6 @@ static int pvt_get_regmap(struct platform_device *pdev, char *reg_name, return 0; } -static void pvt_clk_disable(void *data) -{ - struct pvt_device *pvt = data; - - clk_disable_unprepare(pvt->clk); -} - -static int pvt_clk_enable(struct device *dev, struct pvt_device *pvt) -{ - int ret; - - ret = clk_prepare_enable(pvt->clk); - if (ret) - return ret; - - return devm_add_action_or_reset(dev, pvt_clk_disable, pvt); -} - static void pvt_reset_control_assert(void *data) { struct pvt_device *pvt = data; @@ -799,16 +781,10 @@ static int mr75203_probe(struct platform_device *pdev) if (ret) return ret; - pvt->clk = devm_clk_get(dev, NULL); + pvt->clk = devm_clk_get_enabled(dev, NULL); if (IS_ERR(pvt->clk)) return dev_err_probe(dev, PTR_ERR(pvt->clk), "failed to get clock\n"); - ret = pvt_clk_enable(dev, pvt); - if (ret) { - dev_err(dev, "failed to enable clock\n"); - return ret; - } - pvt->rst = devm_reset_control_get_optional_exclusive(dev, NULL); if (IS_ERR(pvt->rst)) return dev_err_probe(dev, PTR_ERR(pvt->rst), |