Skip to content

Commit 0392727

Browse files
ffainellibroonie
authored andcommitted
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: Florian Fainelli <[email protected]> Signed-off-by: Kamal Dasu <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 4df3bea commit 0392727

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

drivers/spi/spi-bcm-qspi.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1227,6 +1227,11 @@ int bcm_qspi_probe(struct platform_device *pdev,
12271227
}
12281228

12291229
qspi = spi_master_get_devdata(master);
1230+
1231+
qspi->clk = devm_clk_get_optional(&pdev->dev, NULL);
1232+
if (IS_ERR(qspi->clk))
1233+
return PTR_ERR(qspi->clk);
1234+
12301235
qspi->pdev = pdev;
12311236
qspi->trans_pos.trans = NULL;
12321237
qspi->trans_pos.byte = 0;
@@ -1340,13 +1345,6 @@ int bcm_qspi_probe(struct platform_device *pdev,
13401345
qspi->soc_intc = NULL;
13411346
}
13421347

1343-
qspi->clk = devm_clk_get(&pdev->dev, NULL);
1344-
if (IS_ERR(qspi->clk)) {
1345-
dev_warn(dev, "unable to get clock\n");
1346-
ret = PTR_ERR(qspi->clk);
1347-
goto qspi_probe_err;
1348-
}
1349-
13501348
ret = clk_prepare_enable(qspi->clk);
13511349
if (ret) {
13521350
dev_err(dev, "failed to prepare clock\n");

0 commit comments

Comments
 (0)