[PATCH 04/17] spi: img-spfi: Use helper function devm_clk_get_enabled()

Pei Xiao
2026-03-12T23:08:36Z

drivers/spi/spi-img-spfi.c | 14 ++------------
1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/drivers/spi/spi-img-spfi.c b/drivers/spi/spi-img-spfi.c
index 902fb64815c9..a227cff5da70 100644
--- a/drivers/spi/spi-img-spfi.c
+++ b/drivers/spi/spi-img-spfi.c
@@ -557,24 +557,17 @@ static int img_spfi_probe(struct platform_device *pdev)
if (ret)
goto put_spi;

- spfi->sys_clk = devm_clk_get(spfi->dev, "sys");
+ spfi->sys_clk = devm_clk_get_enabled(spfi->dev, "sys");
if (IS_ERR(spfi->sys_clk)) {
ret = PTR_ERR(spfi->sys_clk);
goto put_spi;
}
- spfi->spfi_clk = devm_clk_get(spfi->dev, "spfi");
+ spfi->spfi_clk = devm_clk_get_enabled(spfi->dev, "spfi");
if (IS_ERR(spfi->spfi_clk)) {
ret = PTR_ERR(spfi->spfi_clk);
goto put_spi;
}

- ret = clk_prepare_enable(spfi->sys_clk);
- if (ret)
- goto put_spi;
- ret = clk_prepare_enable(spfi->spfi_clk);
- if (ret)
- goto disable_pclk;
-
spfi_reset(spfi);
/*
* Only enable the error (IACCESS) interrupt. In PIO mode we'll
@@ -655,9 +648,6 @@ static int img_spfi_probe(struct platform_device *pdev)
dma_release_channel(spfi->rx_ch);
if (spfi->tx_ch)
dma_release_channel(spfi->tx_ch);
- clk_disable_unprepare(spfi->spfi_clk);
-disable_pclk:
- clk_disable_unprepare(spfi->sys_clk);
put_spi:
spi_controller_put(host);

--
2.25.1