diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2022-05-20 09:57:37 +0200 |
---|---|---|
committer | Stephen Boyd <sboyd@kernel.org> | 2022-06-15 19:22:29 -0700 |
commit | 68bde8b2e3112d2f1ac52cbf078905f902950146 (patch) | |
tree | 1ed80a59b5f35940b8d6792baa42940951ce92f1 /drivers/clk/meson | |
parent | 7ef9651e9792b08eb310c6beb202cbc947f43cab (diff) | |
download | linux-68bde8b2e3112d2f1ac52cbf078905f902950146.tar.gz linux-68bde8b2e3112d2f1ac52cbf078905f902950146.tar.bz2 linux-68bde8b2e3112d2f1ac52cbf078905f902950146.zip |
clk: meson: axg-audio: Don't duplicate devm_clk_get_enabled()
The clk API just got a function with a slightly different name and
the same functionality. Remove the duplication.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20220520075737.758761-5-u.kleine-koenig@pengutronix.de
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Diffstat (limited to 'drivers/clk/meson')
-rw-r--r-- | drivers/clk/meson/axg-audio.c | 36 |
1 files changed, 4 insertions, 32 deletions
diff --git a/drivers/clk/meson/axg-audio.c b/drivers/clk/meson/axg-audio.c index bfe36bd41339..5016682e47c8 100644 --- a/drivers/clk/meson/axg-audio.c +++ b/drivers/clk/meson/axg-audio.c @@ -1657,35 +1657,6 @@ static struct clk_regmap *const sm1_clk_regmaps[] = { &sm1_sysclk_b_en, }; -static int devm_clk_get_enable(struct device *dev, char *id) -{ - struct clk *clk; - int ret; - - clk = devm_clk_get(dev, id); - if (IS_ERR(clk)) { - ret = PTR_ERR(clk); - dev_err_probe(dev, ret, "failed to get %s", id); - return ret; - } - - ret = clk_prepare_enable(clk); - if (ret) { - dev_err(dev, "failed to enable %s", id); - return ret; - } - - ret = devm_add_action_or_reset(dev, - (void(*)(void *))clk_disable_unprepare, - clk); - if (ret) { - dev_err(dev, "failed to add reset action on %s", id); - return ret; - } - - return 0; -} - struct axg_audio_reset_data { struct reset_controller_dev rstc; struct regmap *map; @@ -1787,6 +1758,7 @@ static int axg_audio_clkc_probe(struct platform_device *pdev) struct regmap *map; void __iomem *regs; struct clk_hw *hw; + struct clk *clk; int ret, i; data = of_device_get_match_data(dev); @@ -1804,9 +1776,9 @@ static int axg_audio_clkc_probe(struct platform_device *pdev) } /* Get the mandatory peripheral clock */ - ret = devm_clk_get_enable(dev, "pclk"); - if (ret) - return ret; + clk = devm_clk_get_enabled(dev, "pclk"); + if (IS_ERR(clk)) + return PTR_ERR(clk); ret = device_reset(dev); if (ret) { |