Skip to contentSkip to conversation

mmc: sdhci-pxav3: avoid of_node

PATCH In review Rosen Penev 2 participants 2 messages Sep 9 – Sep 14

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: sdhci-pxav3: avoid of_node

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.

---
 drivers/mmc/host/sdhci-pxav3.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
drivers/mmc/host/sdhci-pxav3.c +4 -6
index 181b4989c74d..f39764ffd4a0 100644
@@ -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;
Signature · 1 line
2.55.0
#1 lore raw
Quoted 9 lines · Rosen Penev

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.

Applied for next, thanks!

Kind regards
Uffe

Quoted 62 lines
---
 drivers/mmc/host/sdhci-pxav3.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
drivers/mmc/host/sdhci-pxav3.c +4 -7
index 181b4989c74d..f39764ffd4a0 100644
@@ -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