diff mbox series

[1/9] spi: bcm-qspi: Handle clock probe deferral

Message ID 20200416174309.34044-1-kdasu.kdev@gmail.com (mailing list archive)
State Superseded
Headers show
Series [1/9] spi: bcm-qspi: Handle clock probe deferral | expand

Commit Message

Kamal Dasu April 16, 2020, 5:43 p.m. UTC
The clock provider may not be ready by the time spi-bcm-qspi gets
probed, handle probe deferral using devm_clk_get_optional().

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Kamal Dasu <kdasu.kdev@gmail.com>
---
 drivers/spi/spi-bcm-qspi.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

Comments

Mark Brown April 16, 2020, 5:49 p.m. UTC | #1
On Thu, Apr 16, 2020 at 01:43:01PM -0400, Kamal Dasu wrote:
> The clock provider may not be ready by the time spi-bcm-qspi gets
> probed, handle probe deferral using devm_clk_get_optional().
> 
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> Signed-off-by: Kamal Dasu <kdasu.kdev@gmail.com>

Did Florian author this patch or you?  The signoffs look like it was
him.
Florian Fainelli April 16, 2020, 8:55 p.m. UTC | #2
On 4/16/2020 10:49 AM, Mark Brown wrote:
> On Thu, Apr 16, 2020 at 01:43:01PM -0400, Kamal Dasu wrote:
>> The clock provider may not be ready by the time spi-bcm-qspi gets
>> probed, handle probe deferral using devm_clk_get_optional().
>>
>> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
>> Signed-off-by: Kamal Dasu <kdasu.kdev@gmail.com>
> 
> Did Florian author this patch or you?  The signoffs look like it was
> him.

I believe I did author that one ;)
Mark Brown April 17, 2020, 8:41 a.m. UTC | #3
On Thu, Apr 16, 2020 at 01:55:21PM -0700, Florian Fainelli wrote:
> On 4/16/2020 10:49 AM, Mark Brown wrote:

> > Did Florian author this patch or you?  The signoffs look like it was
> > him.

> I believe I did author that one ;)

In that case the patch (and any others that are similar, I saw more)
should say so - please resend with a From: in the patch.  Kamal, if you
do git commit --amend --author='Florian Fainelli <f.fainelli@gmail.com>'
that should do the right thing.
diff mbox series

Patch

diff --git a/drivers/spi/spi-bcm-qspi.c b/drivers/spi/spi-bcm-qspi.c
index 23d295f36c80..74f4579c3f6a 100644
--- a/drivers/spi/spi-bcm-qspi.c
+++ b/drivers/spi/spi-bcm-qspi.c
@@ -1222,6 +1222,11 @@  int bcm_qspi_probe(struct platform_device *pdev,
 	}
 
 	qspi = spi_master_get_devdata(master);
+
+	qspi->clk = devm_clk_get_optional(&pdev->dev, NULL);
+	if (IS_ERR(qspi->clk))
+		return PTR_ERR(qspi->clk);
+
 	qspi->pdev = pdev;
 	qspi->trans_pos.trans = NULL;
 	qspi->trans_pos.byte = 0;
@@ -1335,13 +1340,6 @@  int bcm_qspi_probe(struct platform_device *pdev,
 		qspi->soc_intc = NULL;
 	}
 
-	qspi->clk = devm_clk_get(&pdev->dev, NULL);
-	if (IS_ERR(qspi->clk)) {
-		dev_warn(dev, "unable to get clock\n");
-		ret = PTR_ERR(qspi->clk);
-		goto qspi_probe_err;
-	}
-
 	ret = clk_prepare_enable(qspi->clk);
 	if (ret) {
 		dev_err(dev, "failed to prepare clock\n");