usb: dwc2: Switch to use device_property_count_u32()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tue, 23 Jul 2019 19:16:39 +0000 (22:16 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Jul 2019 09:07:41 +0000 (11:07 +0200)
Use use device_property_count_u32() directly, that makes code neater.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Minas Harutyunyan <hminas@synopsys.com>
Link: https://lore.kernel.org/r/20190723191639.67883-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/dwc2/params.c

index 55f841a..31e090a 100644 (file)
@@ -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,