[PATCH v2 2/3] mmc: dw_mmc-k3: before set biu_clk rate, check biu_clk available or not
From: ping.gao
Date: Thu Feb 12 2026 - 22:04:18 EST
if biu_clk not available, shouldn't set_rate or get_rate
Signed-off-by: ping.gao <ping.gao@xxxxxxxxxxx>
---
drivers/mmc/host/dw_mmc-k3.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/mmc/host/dw_mmc-k3.c b/drivers/mmc/host/dw_mmc-k3.c
index ad6aa1aea549..9c68e162b373 100644
--- a/drivers/mmc/host/dw_mmc-k3.c
+++ b/drivers/mmc/host/dw_mmc-k3.c
@@ -190,6 +190,11 @@ static void dw_mci_hi6220_set_ios(struct dw_mci *host, struct mmc_ios *ios)
int ret;
unsigned int clock;
+ if (IS_ERR_OR_NULL(host->biu_clk)) {
+ dev_warn(host->dev, "biu_clk not available\n");
+ return;
+ }
+
clock = (ios->clock <= 25000000) ? 25000000 : ios->clock;
ret = clk_set_rate(host->biu_clk, clock);
--
2.50.1