Commit 54f5079e authored by Aniket's avatar Aniket Committed by Alexandre Belloni

i3c: dw: Use new *_enabled clk API

Move to "enabled" variant of clk_get API. It takes care
of enable and disable calls during the probe and remove.
Signed-off-by: default avatarAniket <aniketmaurya@google.com>
Link: https://lore.kernel.org/r/20240628154603.326075-1-aniketmaurya@google.comSigned-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
parent 71134c13
...@@ -1450,7 +1450,7 @@ int dw_i3c_common_probe(struct dw_i3c_master *master, ...@@ -1450,7 +1450,7 @@ int dw_i3c_common_probe(struct dw_i3c_master *master,
if (IS_ERR(master->regs)) if (IS_ERR(master->regs))
return PTR_ERR(master->regs); return PTR_ERR(master->regs);
master->core_clk = devm_clk_get(&pdev->dev, NULL); master->core_clk = devm_clk_get_enabled(&pdev->dev, NULL);
if (IS_ERR(master->core_clk)) if (IS_ERR(master->core_clk))
return PTR_ERR(master->core_clk); return PTR_ERR(master->core_clk);
...@@ -1459,10 +1459,6 @@ int dw_i3c_common_probe(struct dw_i3c_master *master, ...@@ -1459,10 +1459,6 @@ int dw_i3c_common_probe(struct dw_i3c_master *master,
if (IS_ERR(master->core_rst)) if (IS_ERR(master->core_rst))
return PTR_ERR(master->core_rst); return PTR_ERR(master->core_rst);
ret = clk_prepare_enable(master->core_clk);
if (ret)
goto err_disable_core_clk;
reset_control_deassert(master->core_rst); reset_control_deassert(master->core_rst);
spin_lock_init(&master->xferqueue.lock); spin_lock_init(&master->xferqueue.lock);
...@@ -1501,9 +1497,6 @@ int dw_i3c_common_probe(struct dw_i3c_master *master, ...@@ -1501,9 +1497,6 @@ int dw_i3c_common_probe(struct dw_i3c_master *master,
err_assert_rst: err_assert_rst:
reset_control_assert(master->core_rst); reset_control_assert(master->core_rst);
err_disable_core_clk:
clk_disable_unprepare(master->core_clk);
return ret; return ret;
} }
EXPORT_SYMBOL_GPL(dw_i3c_common_probe); EXPORT_SYMBOL_GPL(dw_i3c_common_probe);
...@@ -1513,8 +1506,6 @@ void dw_i3c_common_remove(struct dw_i3c_master *master) ...@@ -1513,8 +1506,6 @@ void dw_i3c_common_remove(struct dw_i3c_master *master)
i3c_master_unregister(&master->base); i3c_master_unregister(&master->base);
reset_control_assert(master->core_rst); reset_control_assert(master->core_rst);
clk_disable_unprepare(master->core_clk);
} }
EXPORT_SYMBOL_GPL(dw_i3c_common_remove); EXPORT_SYMBOL_GPL(dw_i3c_common_remove);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment