[PATCH v3 2/3] mmc: dw_mmc-k3: before set biu_clk rate, check biu_clk available or not

From: ping.gao

Date: Fri Feb 13 2026 - 00:30:12 EST


If biu_clk is not available, no need try to set and get
rate of it, just bail out and print a warning

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..ccb6bfe3e0ce 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_err(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