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/ltc2947-core.c | |
parent | 903882c767051a17c1535b2a820e2931ee44b8fb (diff) | |
download | linux-0dee25ebc7d315d9ee785ea5f457ae980979ea89.tar.gz linux-0dee25ebc7d315d9ee785ea5f457ae980979ea89.tar.bz2 linux-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/ltc2947-core.c')
-rw-r--r-- | drivers/hwmon/ltc2947-core.c | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/drivers/hwmon/ltc2947-core.c b/drivers/hwmon/ltc2947-core.c index 5423466de697..626f5bf2c9c7 100644 --- a/drivers/hwmon/ltc2947-core.c +++ b/drivers/hwmon/ltc2947-core.c @@ -956,13 +956,6 @@ static struct attribute *ltc2947_attrs[] = { }; ATTRIBUTE_GROUPS(ltc2947); -static void ltc2947_clk_disable(void *data) -{ - struct clk *extclk = data; - - clk_disable_unprepare(extclk); -} - static int ltc2947_setup(struct ltc2947_data *st) { int ret; @@ -989,7 +982,7 @@ static int ltc2947_setup(struct ltc2947_data *st) return ret; /* check external clock presence */ - extclk = devm_clk_get_optional(st->dev, NULL); + extclk = devm_clk_get_optional_enabled(st->dev, NULL); if (IS_ERR(extclk)) return dev_err_probe(st->dev, PTR_ERR(extclk), "Failed to get external clock\n"); @@ -1007,14 +1000,6 @@ static int ltc2947_setup(struct ltc2947_data *st) return -EINVAL; } - ret = clk_prepare_enable(extclk); - if (ret) - return ret; - - ret = devm_add_action_or_reset(st->dev, ltc2947_clk_disable, - extclk); - if (ret) - return ret; /* as in table 1 of the datasheet */ if (rate_hz >= LTC2947_CLK_MIN && rate_hz <= 1000000) pre = 0; |