Skip to contentSkip to conversation

mmc: dw_mmc: Use device_property_string_array_count()

PATCH In review Andy Shevchenko 2 participants 2 messages Feb 2, 2022 – Feb 8, 2022

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

PATCH 1/1 mmc: dw_mmc: Use device_property_string_array_count()

Use device_property_string_array_count() to get number of strings in a string array property.

---
 drivers/mmc/host/dw_mmc.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/mmc/host/dw_mmc.c +1 -2
index 99b201921954..3420a7ad6098 100644
@@ -3057,8 +3057,7 @@ static void dw_mci_init_dma(struct dw_mci *host)
 		dev_info(host->dev, "Using internal DMA controller.\n");
 	} else {
 		/* TRANS_MODE_EDMAC: check dma bindings again */
-		if ((device_property_read_string_array(dev, "dma-names",
-						       NULL, 0) < 0) ||
+		if ((device_property_string_array_count(dev, "dma-names") < 0) ||
 		    !device_property_present(dev, "dmas")) {
 			goto no_dma;
 		}
Signature · 1 line
2.34.1
#1 lore raw
Quoted 5 lines · Andy Shevchenko

Use device_property_string_array_count() to get number of strings in a string array property.

Applied for next, thanks!

Kind regards
Uffe

Quoted 21 lines
---
 drivers/mmc/host/dw_mmc.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/mmc/host/dw_mmc.c +1 -3
index 99b201921954..3420a7ad6098 100644
@@ -3057,8 +3057,7 @@ static void dw_mci_init_dma(struct dw_mci *host)
                dev_info(host->dev, "Using internal DMA controller.\n");
        } else {
                /* TRANS_MODE_EDMAC: check dma bindings again */
-               if ((device_property_read_string_array(dev, "dma-names",
-                                                      NULL, 0) < 0) ||
+               if ((device_property_string_array_count(dev, "dma-names") < 0) ||
                    !device_property_present(dev, "dmas")) {
                        goto no_dma;
                }
--

2.34.1