[PATCH v2 4/4] mmc: sdhci-pltfm: remove duplicate DTS property parsing

ziniu.wang_1@nxp.com posted 4 patches 1 month, 1 week ago
There is a newer version of this series
[PATCH v2 4/4] mmc: sdhci-pltfm: remove duplicate DTS property parsing
Posted by ziniu.wang_1@nxp.com 1 month, 1 week ago
From: Luke Wang <ziniu.wang_1@nxp.com>

The "keep-power-in-suspend", "wakeup-source" and "enable-sdio-wakeup"
properties are already parsed in mmc_of_parse(). All sdhci drivers that
call sdhci_get_property() also call mmc_of_parse(). The only exception
is sdhci-of-hlwd, which does not call mmc_of_parse(), but its devicetree
does not use these properties anyway.

Signed-off-by: Luke Wang <ziniu.wang_1@nxp.com>
---
 drivers/mmc/host/sdhci-pltfm.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/drivers/mmc/host/sdhci-pltfm.c b/drivers/mmc/host/sdhci-pltfm.c
index d4fb60c1ef69..933fafe0a0ef 100644
--- a/drivers/mmc/host/sdhci-pltfm.c
+++ b/drivers/mmc/host/sdhci-pltfm.c
@@ -95,13 +95,6 @@ void sdhci_get_property(struct platform_device *pdev)
 	sdhci_get_compatibility(pdev);
 
 	device_property_read_u32(dev, "clock-frequency", &pltfm_host->clock);
-
-	if (device_property_present(dev, "keep-power-in-suspend"))
-		host->mmc->pm_caps |= MMC_PM_KEEP_POWER;
-
-	if (device_property_read_bool(dev, "wakeup-source") ||
-	    device_property_read_bool(dev, "enable-sdio-wakeup")) /* legacy */
-		host->mmc->pm_caps |= MMC_PM_WAKE_SDIO_IRQ;
 }
 EXPORT_SYMBOL_GPL(sdhci_get_property);
 
-- 
2.34.1
Re: [PATCH v2 4/4] mmc: sdhci-pltfm: remove duplicate DTS property parsing
Posted by Adrian Hunter 4 weeks, 1 day ago
On 03/03/2026 12:50, ziniu.wang_1@nxp.com wrote:
> From: Luke Wang <ziniu.wang_1@nxp.com>
> 
> The "keep-power-in-suspend", "wakeup-source" and "enable-sdio-wakeup"
> properties are already parsed in mmc_of_parse(). All sdhci drivers that
> call sdhci_get_property() also call mmc_of_parse(). The only exception
> is sdhci-of-hlwd, which does not call mmc_of_parse(), but its devicetree
> does not use these properties anyway.
> 
> Signed-off-by: Luke Wang <ziniu.wang_1@nxp.com>

Acked-by: Adrian Hunter <adrian.hunter@intel.com>

> ---
>  drivers/mmc/host/sdhci-pltfm.c | 7 -------
>  1 file changed, 7 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci-pltfm.c b/drivers/mmc/host/sdhci-pltfm.c
> index d4fb60c1ef69..933fafe0a0ef 100644
> --- a/drivers/mmc/host/sdhci-pltfm.c
> +++ b/drivers/mmc/host/sdhci-pltfm.c
> @@ -95,13 +95,6 @@ void sdhci_get_property(struct platform_device *pdev)
>  	sdhci_get_compatibility(pdev);
>  
>  	device_property_read_u32(dev, "clock-frequency", &pltfm_host->clock);
> -
> -	if (device_property_present(dev, "keep-power-in-suspend"))
> -		host->mmc->pm_caps |= MMC_PM_KEEP_POWER;
> -
> -	if (device_property_read_bool(dev, "wakeup-source") ||
> -	    device_property_read_bool(dev, "enable-sdio-wakeup")) /* legacy */
> -		host->mmc->pm_caps |= MMC_PM_WAKE_SDIO_IRQ;
>  }
>  EXPORT_SYMBOL_GPL(sdhci_get_property);
>
Re: [PATCH v2 4/4] mmc: sdhci-pltfm: remove duplicate DTS property parsing
Posted by Frank Li 1 month ago
From: Frank Li (AI-BOT) <frank.li@nxp.com>

AI bot review and may be useless.

The patch looks reasonable. The commit message correctly identifies that
mmc_of_parse() already handles these three properties, and the analysis
that all callers of sdhci_get_property() also invoke mmc_of_parse()
(except sdhci-of-hlwd, which doesn't use them) is sound.

However, the commit message should explicitly state *where* these
properties are parsed in mmc_of_parse(). A reader should be able to
verify the claim by grepping drivers/mmc/core/host.c without guessing.

Also, the claim about sdhci-of-hlwd deserves a quick verification: does
its devicetree binding documentation confirm these properties are unused?
If so, mention the file path in the commit message for future
maintainers.

The code deletion itself is correct—no resource leaks or logic errors.