[PATCH] mmc: sdhci-pxav3: avoid of_node

Rosen Penev posted 1 patch 2 weeks, 1 day ago
drivers/mmc/host/sdhci-pxav3.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
[PATCH] mmc: sdhci-pxav3: avoid of_node
Posted by Rosen Penev 2 weeks, 1 day ago
Use device handlers instead of of_node ones for simplicity.

As this driver is effectively OF only, it ends up behaving the same.

Change is_bool to present as no-1-8-v is not specified as a bool in dts,
but as either present or not.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 drivers/mmc/host/sdhci-pxav3.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/mmc/host/sdhci-pxav3.c b/drivers/mmc/host/sdhci-pxav3.c
index 181b4989c74d..f39764ffd4a0 100644
--- a/drivers/mmc/host/sdhci-pxav3.c
+++ b/drivers/mmc/host/sdhci-pxav3.c
@@ -123,7 +123,7 @@ static int mv_conf_mbus_windows(struct platform_device *pdev,
 static int armada_38x_quirks(struct platform_device *pdev,
 			     struct sdhci_host *host)
 {
-	struct device_node *np = pdev->dev.of_node;
+	struct device *dev = &pdev->dev;
 	struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
 	struct sdhci_pxa *pxa = sdhci_pltfm_priv(pltfm_host);
 	struct resource *res;
@@ -155,7 +155,7 @@ static int armada_38x_quirks(struct platform_device *pdev,
 	 * controller has different capabilities than the ones shown
 	 * in its registers
 	 */
-	if (of_property_read_bool(np, "no-1-8-v")) {
+	if (device_property_present(dev, "no-1-8-v")) {
 		host->caps &= ~SDHCI_CAN_VDD_180;
 		host->mmc->caps &= ~MMC_CAP_1_8V_DDR;
 	} else {
@@ -364,14 +364,13 @@ MODULE_DEVICE_TABLE(of, sdhci_pxav3_of_match);
 static struct sdhci_pxa_platdata *pxav3_get_mmc_pdata(struct device *dev)
 {
 	struct sdhci_pxa_platdata *pdata;
-	struct device_node *np = dev->of_node;
 	u32 clk_delay_cycles;
 
 	pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
 	if (!pdata)
 		return NULL;
 
-	if (!of_property_read_u32(np, "mrvl,clk-delay-cycles",
+	if (!device_property_read_u32(dev, "mrvl,clk-delay-cycles",
 				  &clk_delay_cycles))
 		pdata->clk_delay_cycles = clk_delay_cycles;
 
@@ -402,7 +401,6 @@ static int sdhci_pxav3_probe(struct platform_device *pdev)
 	struct sdhci_pltfm_host *pltfm_host;
 	struct sdhci_pxa_platdata *pdata = pdev->dev.platform_data;
 	struct device *dev = &pdev->dev;
-	struct device_node *np = pdev->dev.of_node;
 	struct sdhci_host *host = NULL;
 	struct sdhci_pxa *pxa = NULL;
 	const struct of_device_id *match;
@@ -433,7 +431,7 @@ static int sdhci_pxav3_probe(struct platform_device *pdev)
 	/* enable 1/8V DDR capable */
 	host->mmc->caps |= MMC_CAP_1_8V_DDR;
 
-	if (of_device_is_compatible(np, "marvell,armada-380-sdhci")) {
+	if (device_is_compatible(dev, "marvell,armada-380-sdhci")) {
 		ret = armada_38x_quirks(pdev, host);
 		if (ret < 0)
 			goto err_mbus_win;
-- 
2.55.0
Re: [PATCH] mmc: sdhci-pxav3: avoid of_node
Posted by Ulf Hansson 1 week, 4 days ago
On Thu, Sep 10, 2026 at 12:24 AM Rosen Penev <rosenp@gmail.com> wrote:
>
> Use device handlers instead of of_node ones for simplicity.
>
> As this driver is effectively OF only, it ends up behaving the same.
>
> Change is_bool to present as no-1-8-v is not specified as a bool in dts,
> but as either present or not.
>
> Signed-off-by: Rosen Penev <rosenp@gmail.com>

Applied for next, thanks!

Kind regards
Uffe


> ---
>  drivers/mmc/host/sdhci-pxav3.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-pxav3.c b/drivers/mmc/host/sdhci-pxav3.c
> index 181b4989c74d..f39764ffd4a0 100644
> --- a/drivers/mmc/host/sdhci-pxav3.c
> +++ b/drivers/mmc/host/sdhci-pxav3.c
> @@ -123,7 +123,7 @@ static int mv_conf_mbus_windows(struct platform_device *pdev,
>  static int armada_38x_quirks(struct platform_device *pdev,
>                              struct sdhci_host *host)
>  {
> -       struct device_node *np = pdev->dev.of_node;
> +       struct device *dev = &pdev->dev;
>         struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
>         struct sdhci_pxa *pxa = sdhci_pltfm_priv(pltfm_host);
>         struct resource *res;
> @@ -155,7 +155,7 @@ static int armada_38x_quirks(struct platform_device *pdev,
>          * controller has different capabilities than the ones shown
>          * in its registers
>          */
> -       if (of_property_read_bool(np, "no-1-8-v")) {
> +       if (device_property_present(dev, "no-1-8-v")) {
>                 host->caps &= ~SDHCI_CAN_VDD_180;
>                 host->mmc->caps &= ~MMC_CAP_1_8V_DDR;
>         } else {
> @@ -364,14 +364,13 @@ MODULE_DEVICE_TABLE(of, sdhci_pxav3_of_match);
>  static struct sdhci_pxa_platdata *pxav3_get_mmc_pdata(struct device *dev)
>  {
>         struct sdhci_pxa_platdata *pdata;
> -       struct device_node *np = dev->of_node;
>         u32 clk_delay_cycles;
>
>         pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
>         if (!pdata)
>                 return NULL;
>
> -       if (!of_property_read_u32(np, "mrvl,clk-delay-cycles",
> +       if (!device_property_read_u32(dev, "mrvl,clk-delay-cycles",
>                                   &clk_delay_cycles))
>                 pdata->clk_delay_cycles = clk_delay_cycles;
>
> @@ -402,7 +401,6 @@ static int sdhci_pxav3_probe(struct platform_device *pdev)
>         struct sdhci_pltfm_host *pltfm_host;
>         struct sdhci_pxa_platdata *pdata = pdev->dev.platform_data;
>         struct device *dev = &pdev->dev;
> -       struct device_node *np = pdev->dev.of_node;
>         struct sdhci_host *host = NULL;
>         struct sdhci_pxa *pxa = NULL;
>         const struct of_device_id *match;
> @@ -433,7 +431,7 @@ static int sdhci_pxav3_probe(struct platform_device *pdev)
>         /* enable 1/8V DDR capable */
>         host->mmc->caps |= MMC_CAP_1_8V_DDR;
>
> -       if (of_device_is_compatible(np, "marvell,armada-380-sdhci")) {
> +       if (device_is_compatible(dev, "marvell,armada-380-sdhci")) {
>                 ret = armada_38x_quirks(pdev, host);
>                 if (ret < 0)
>                         goto err_mbus_win;
> --
> 2.55.0
>