Commit 0392727c authored by Florian Fainelli's avatar Florian Fainelli Committed by Mark Brown

spi: bcm-qspi: Handle clock probe deferral

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: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarKamal Dasu <kdasu.kdev@gmail.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20200420190853.45614-2-kdasu.kdev@gmail.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 4df3bea7
...@@ -1227,6 +1227,11 @@ int bcm_qspi_probe(struct platform_device *pdev, ...@@ -1227,6 +1227,11 @@ int bcm_qspi_probe(struct platform_device *pdev,
} }
qspi = spi_master_get_devdata(master); 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->pdev = pdev;
qspi->trans_pos.trans = NULL; qspi->trans_pos.trans = NULL;
qspi->trans_pos.byte = 0; qspi->trans_pos.byte = 0;
...@@ -1340,13 +1345,6 @@ int bcm_qspi_probe(struct platform_device *pdev, ...@@ -1340,13 +1345,6 @@ int bcm_qspi_probe(struct platform_device *pdev,
qspi->soc_intc = NULL; 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); ret = clk_prepare_enable(qspi->clk);
if (ret) { if (ret) {
dev_err(dev, "failed to prepare clock\n"); dev_err(dev, "failed to prepare clock\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment