Re: [PATCH] drivers: dw_mmc: Replace devm_clk_get with devm_clk_get_optional

From: Shawn Lin

Date: Thu Feb 12 2026 - 05:46:10 EST




在 2026/02/12 星期四 18:36, ping.gao 写道:
在 2026/01/23 星期五 18:56, shawn lin 写道:



...



1. I think "synopsys-dw-mshc.yaml" needn't change , because biu must be set for hisilicon, they will set rate for biu_clk


No, otherwise you can't pass the dtschema checking.


2. we should add another patch for hisilicon like below, do you agree?


diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c


Please check it in dw_mmc-k3 code.


index 6bcc1e7233c0..7a2149435894 100644


--- a/drivers/mmc/host/dw_mmc.c


+++ b/drivers/mmc/host/dw_mmc.c


@@ -3383,6 +3383,17 @@ int dw_mci_probe(struct dw_mci *host)


return ret;





} else {


+ const char *compatible_str = NULL;


+


+ if (of_property_read_string(host->dev->of_node, "compatible",


+ &compatible_str) == 0) {


+ if (strstr(compatible_str, "hisilicon")) {


+ if (!host->biu_clk) {


+ dev_err(host->dev, "biu clock not available ,it must be set\n");


+ return -EINVAL;


+ }


+ }


+ }


ret = clk_prepare_enable(host->biu_clk);


if (ret) {


dev_err(host->dev, "failed to enable biu clock\n");


--


could you please give me some advice? thanks.


Gaoping





if (IS_ERR(host->biu_clk)) {


dev_dbg(host->dev, "biu clock not available\n");


ret = PTR_ERR(host->biu_clk);