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

From: Shawn Lin

Date: Fri Feb 13 2026 - 01:59:52 EST



在 2026/02/13 星期五 11:08, ping.gao 写道:
if biu_clk not available, shouldn't set_rate or get_rate


I would rephrase something like this:
If biu_clk is not available, no need to 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..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");

dev_err(host->dev, "biu_clk is not available\n");

Should be a error for k3 driver as it needs biu_clk.

+ return;
+ }
+
clock = (ios->clock <= 25000000) ? 25000000 : ios->clock;
ret = clk_set_rate(host->biu_clk, clock);