Skip to contentSkip to conversation

usb: dwc2: Switch to use device_property_count_u32()

PATCH In review Andy Shevchenko 2 participants 2 messages Jul 23, 2019 – Jul 25, 2019

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

PATCH 1/1 usb: dwc2: Switch to use device_property_count_u32()

Use use device_property_count_u32() directly, that makes code neater.

---
 drivers/usb/dwc2/params.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/usb/dwc2/params.c +1 -4
index 55f841a54015..31e090ac9f1e 100644
@@ -404,10 +404,7 @@ static void dwc2_get_device_properties(struct dwc2_hsotg *hsotg)
 		device_property_read_u32(hsotg->dev, "g-np-tx-fifo-size",
 					 &p->g_np_tx_fifo_size);
 
-		num = device_property_read_u32_array(hsotg->dev,
-						     "g-tx-fifo-size",
-						     NULL, 0);
-
+		num = device_property_count_u32(hsotg->dev, "g-tx-fifo-size");
 		if (num > 0) {
 			num = min(num, 15);
 			memset(p->g_tx_fifo_size, 0,
Signature · 1 line
2.20.1
Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Andy Shevchenko

Use use device_property_count_u32() directly, that makes code neater.

---

Quoted 20 lines
  drivers/usb/dwc2/params.c | 5 +----
  1 file changed, 1 insertion(+), 4 deletions(-)
drivers/usb/dwc2/params.c +1 -4
index 55f841a54015..31e090ac9f1e 100644
@@ -404,10 +404,7 @@ static void dwc2_get_device_properties(struct dwc2_hsotg *hsotg)
  		device_property_read_u32(hsotg->dev, "g-np-tx-fifo-size",
  					 &p->g_np_tx_fifo_size);
 
-		num = device_property_read_u32_array(hsotg->dev,
-						     "g-tx-fifo-size",
-						     NULL, 0);
-
+		num = device_property_count_u32(hsotg->dev, "g-tx-fifo-size");
  		if (num > 0) {
  			num = min(num, 15);
  			memset(p->g_tx_fifo_size, 0,