LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] Enable the clock before calling clk_get_rate().
@ 2018-04-19 13:03 Stefan Potyra
  2018-04-21 23:10 ` Florian Fainelli
  0 siblings, 1 reply; 10+ messages in thread
From: Stefan Potyra @ 2018-04-19 13:03 UTC (permalink / raw)
  To: Mark Brown, Florian Fainelli, bcm-kernel-feedback-list,
	linux-spi, linux-arm-kernel, linux-kernel
  Cc: ldv-project, sil2review

Found by Linux Driver Verification project (linuxtesting.org).

Fixes: 142168eba9dc spi: bcm63xx-hsspi: add bcm63xx HSSPI driver
Signed-off-by: Stefan Potyra <Stefan.Potyra@elektrobit.com>
---
 drivers/spi/spi-bcm63xx-hsspi.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-bcm63xx-hsspi.c b/drivers/spi/spi-bcm63xx-hsspi.c
index cbcba614b253..46cd9b683d22 100644
--- a/drivers/spi/spi-bcm63xx-hsspi.c
+++ b/drivers/spi/spi-bcm63xx-hsspi.c
@@ -352,6 +352,10 @@ static int bcm63xx_hsspi_probe(struct platform_device *pdev)
 	if (IS_ERR(clk))
 		return PTR_ERR(clk);
 
+	ret = clk_prepare_enable(clk);
+	if (ret)
+		return ret;
+
 	rate = clk_get_rate(clk);
 	if (!rate) {
 		struct clk *pll_clk = devm_clk_get(dev, "pll");
@@ -364,10 +368,6 @@ static int bcm63xx_hsspi_probe(struct platform_device *pdev)
 			return -EINVAL;
 	}
 
-	ret = clk_prepare_enable(clk);
-	if (ret)
-		return ret;
-
 	master = spi_alloc_master(&pdev->dev, sizeof(*bs));
 	if (!master) {
 		ret = -ENOMEM;
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2018-04-26 11:54 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-19 13:03 [PATCH] Enable the clock before calling clk_get_rate() Stefan Potyra
2018-04-21 23:10 ` Florian Fainelli
2018-04-24 16:16   ` [PATCH v2] spi/bcm63xx-hspi: " Stefan Potyra
2018-04-24 17:32     ` Mark Brown
2018-04-25 13:47       ` [PATCH v3] spi/bcm63xx-hspi: Enable the clock before calling Stefan Potyra
2018-04-25 15:50         ` Mark Brown
2018-04-25 16:49           ` [PATCH v4] spi/bcm63xx-hspi: Enable the clock before calling clk_get_rate() Stefan Potyra
2018-04-25 17:28             ` Mark Brown
2018-04-26  7:28               ` [PATCH v5] " Stefan Potyra
2018-04-26 11:53                 ` Applied "spi/bcm63xx-hspi: Enable the clock before calling clk_get_rate()." to the spi tree Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).