openwrt/target/linux/rockchip/patches-6.6/302-mmc-allow-probe-to-defer-if-clock-is-not-ready.patch
Ben Whitten cc9df2da0d rockchip: add NanoPi R6S support
Add patches for the nanopi r6s board, backporting from 6.9 where
basic support is landing.

Signed-off-by: Ben Whitten <ben.whitten@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/15607
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-08-11 18:56:27 +02:00

26 lines
793 B
Diff

--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -3294,6 +3294,10 @@ int dw_mci_probe(struct dw_mci *host)
host->biu_clk = devm_clk_get(host->dev, "biu");
if (IS_ERR(host->biu_clk)) {
dev_dbg(host->dev, "biu clock not available\n");
+ ret = PTR_ERR(host->biu_clk);
+ if (ret == -EPROBE_DEFER) {
+ return ret;
+ }
} else {
ret = clk_prepare_enable(host->biu_clk);
if (ret) {
@@ -3305,6 +3309,11 @@ int dw_mci_probe(struct dw_mci *host)
host->ciu_clk = devm_clk_get(host->dev, "ciu");
if (IS_ERR(host->ciu_clk)) {
dev_dbg(host->dev, "ciu clock not available\n");
+ ret = PTR_ERR(host->ciu_clk);
+ if (ret == -EPROBE_DEFER) {
+ goto err_clk_biu;
+ }
+
host->bus_hz = host->pdata->bus_hz;
} else {
ret = clk_prepare_enable(host->ciu_clk);