diff mbox series

[1/3] spi: spi-sn-f-ospi: Use devm_clk_get_enabled()

Message ID 20230528195830.164669-1-lars@metafoo.de
State Accepted
Commit 5363073dfcf087393c0587e9217ef50b1d63fcce
Headers show
Series [1/3] spi: spi-sn-f-ospi: Use devm_clk_get_enabled() | expand

Commit Message

Lars-Peter Clausen May 28, 2023, 7:58 p.m. UTC
Replace the combination of devm_clk_get_enable() plus clk_prepare_enable()
with devm_clk_get_enabled(). Slightly reduces the amount of boilerplate
code.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 drivers/spi/spi-sn-f-ospi.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

Comments

Mark Brown May 30, 2023, 5:40 p.m. UTC | #1
On Sun, 28 May 2023 12:58:28 -0700, Lars-Peter Clausen wrote:
> Replace the combination of devm_clk_get_enable() plus clk_prepare_enable()
> with devm_clk_get_enabled(). Slightly reduces the amount of boilerplate
> code.
> 
> 

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/3] spi: spi-sn-f-ospi: Use devm_clk_get_enabled()
      commit: 5363073dfcf087393c0587e9217ef50b1d63fcce
[2/3] spi: spi-sn-f-ospi: Use min_t instead of opencoding it
      commit: 282152fa9d54a84a486b93a913934c21503fb5db
[3/3] spi: spi-sn-f-ospi: Make read-only array `width_available` static const
      commit: 81ea9a0710bcf74934446f63898f0186aeb2b5b8

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark
diff mbox series

Patch

diff --git a/drivers/spi/spi-sn-f-ospi.c b/drivers/spi/spi-sn-f-ospi.c
index a2bd9dcde075..39c4df54cdb8 100644
--- a/drivers/spi/spi-sn-f-ospi.c
+++ b/drivers/spi/spi-sn-f-ospi.c
@@ -634,18 +634,12 @@  static int f_ospi_probe(struct platform_device *pdev)
 		goto err_put_ctlr;
 	}
 
-	ospi->clk = devm_clk_get(dev, NULL);
+	ospi->clk = devm_clk_get_enabled(dev, NULL);
 	if (IS_ERR(ospi->clk)) {
 		ret = PTR_ERR(ospi->clk);
 		goto err_put_ctlr;
 	}
 
-	ret = clk_prepare_enable(ospi->clk);
-	if (ret) {
-		dev_err(dev, "Failed to enable the clock\n");
-		goto err_disable_clk;
-	}
-
 	mutex_init(&ospi->mlock);
 
 	ret = f_ospi_init(ospi);
@@ -661,9 +655,6 @@  static int f_ospi_probe(struct platform_device *pdev)
 err_destroy_mutex:
 	mutex_destroy(&ospi->mlock);
 
-err_disable_clk:
-	clk_disable_unprepare(ospi->clk);
-
 err_put_ctlr:
 	spi_controller_put(ctlr);
 
@@ -674,8 +665,6 @@  static void f_ospi_remove(struct platform_device *pdev)
 {
 	struct f_ospi *ospi = platform_get_drvdata(pdev);
 
-	clk_disable_unprepare(ospi->clk);
-
 	mutex_destroy(&ospi->mlock);
 }