summaryrefslogtreecommitdiffstats
path: root/drivers/bus
diff options
context:
space:
mode:
authorWu Bo <bo.wu@vivo.com>2024-08-27 04:49:44 +0200
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>2024-08-29 10:44:53 +0200
commit854527e0fb9142fa6aea2ca24741ca25c23a0bec (patch)
treeef4858e44a617d5a799357cf0b6b538a9d2ad48e /drivers/bus
parentMIPS: dec: prom: Remove unused unregister_prom_console() declaration (diff)
downloadlinux-854527e0fb9142fa6aea2ca24741ca25c23a0bec.tar.xz
linux-854527e0fb9142fa6aea2ca24741ca25c23a0bec.zip
bus: bt1-axi: change to use devm_clk_get_enabled() helper
Use devm_clk_get_enabled() instead of devm_clk_get() to make the code cleaner and avoid calling clk_disable_unprepare() Signed-off-by: Wu Bo <bo.wu@vivo.com> Acked-by: Serge Semin <fancer.lancer@gmail.com> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Diffstat (limited to 'drivers/bus')
-rw-r--r--drivers/bus/bt1-axi.c23
1 files changed, 2 insertions, 21 deletions
diff --git a/drivers/bus/bt1-axi.c b/drivers/bus/bt1-axi.c
index 4007e7322cf2..a5254c73bf43 100644
--- a/drivers/bus/bt1-axi.c
+++ b/drivers/bus/bt1-axi.c
@@ -146,33 +146,14 @@ static int bt1_axi_request_rst(struct bt1_axi *axi)
return ret;
}
-static void bt1_axi_disable_clk(void *data)
-{
- struct bt1_axi *axi = data;
-
- clk_disable_unprepare(axi->aclk);
-}
-
static int bt1_axi_request_clk(struct bt1_axi *axi)
{
- int ret;
-
- axi->aclk = devm_clk_get(axi->dev, "aclk");
+ axi->aclk = devm_clk_get_enabled(axi->dev, "aclk");
if (IS_ERR(axi->aclk))
return dev_err_probe(axi->dev, PTR_ERR(axi->aclk),
"Couldn't get AXI Interconnect clock\n");
- ret = clk_prepare_enable(axi->aclk);
- if (ret) {
- dev_err(axi->dev, "Couldn't enable the AXI clock\n");
- return ret;
- }
-
- ret = devm_add_action_or_reset(axi->dev, bt1_axi_disable_clk, axi);
- if (ret)
- dev_err(axi->dev, "Can't add AXI clock disable action\n");
-
- return ret;
+ return 0;
}
static int bt1_axi_request_irq(struct bt1_axi *axi)