[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240624052851.1030799-4-aniketmaurya@google.com>
Date: Mon, 24 Jun 2024 05:28:51 +0000
From: Aniket <aniketmaurya@...gle.com>
To: Alexandre Belloni <alexandre.belloni@...tlin.com>, Jeremy Kerr <jk@...econstruct.com.au>,
Joel Stanley <joel@....id.au>, Billy Tsai <billy_tsai@...eedtech.com>,
Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>
Cc: linux-i3c@...ts.infradead.org, linux-kernel@...r.kernel.org,
devicetree@...r.kernel.org, Aniket <aniketmaurya@...gle.com>
Subject: [PATCH v2 3/3] i3c: dw: Use new *_enabled clk APIs
Move to "enabled" variant of clk_get APIs. It takes care
of enable and disable calls during the probe and remove.
Signed-off-by: Aniket <aniketmaurya@...gle.com>
---
drivers/i3c/master/dw-i3c-master.c | 21 ++-------------------
1 file changed, 2 insertions(+), 19 deletions(-)
diff --git a/drivers/i3c/master/dw-i3c-master.c b/drivers/i3c/master/dw-i3c-master.c
index 41cdfd6741e3..37092b8e964f 100644
--- a/drivers/i3c/master/dw-i3c-master.c
+++ b/drivers/i3c/master/dw-i3c-master.c
@@ -1466,11 +1466,11 @@ int dw_i3c_common_probe(struct dw_i3c_master *master,
if (IS_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))
return PTR_ERR(master->core_clk);
- master->pclk = devm_clk_get_optional(&pdev->dev, "pclk");
+ master->pclk = devm_clk_get_optional_enabled(&pdev->dev, "pclk");
if (IS_ERR(master->pclk))
return PTR_ERR(master->pclk);
@@ -1479,14 +1479,6 @@ int dw_i3c_common_probe(struct dw_i3c_master *master,
if (IS_ERR(master->core_rst))
return PTR_ERR(master->core_rst);
- ret = clk_prepare_enable(master->core_clk);
- if (ret)
- return ret;
-
- ret = clk_prepare_enable(master->pclk);
- if (ret)
- goto err_disable_core_clk;
-
reset_control_deassert(master->core_rst);
spin_lock_init(&master->xferqueue.lock);
@@ -1528,11 +1520,6 @@ int dw_i3c_common_probe(struct dw_i3c_master *master,
err_assert_rst:
reset_control_assert(master->core_rst);
- clk_disable_unprepare(master->pclk);
-
-err_disable_core_clk:
- clk_disable_unprepare(master->core_clk);
-
return ret;
}
EXPORT_SYMBOL_GPL(dw_i3c_common_probe);
@@ -1542,10 +1529,6 @@ void dw_i3c_common_remove(struct dw_i3c_master *master)
i3c_master_unregister(&master->base);
reset_control_assert(master->core_rst);
-
- clk_disable_unprepare(master->pclk);
-
- clk_disable_unprepare(master->core_clk);
}
EXPORT_SYMBOL_GPL(dw_i3c_common_remove);
--
2.45.2.741.gdbec12cfda-goog
Powered by blists - more mailing lists