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

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20190723193750.69038-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/tcpm/tcpm.c

index fba32d84e5787f2f0b47a94d7c61e0b16747e190..ec525811a9eb45b8f6d3606b81f9dbce895e27e7 100644 (file)
@@ -4410,8 +4410,7 @@ static int tcpm_fw_get_caps(struct tcpm_port *port,
                goto sink;
 
        /* Get source pdos */
-       ret = fwnode_property_read_u32_array(fwnode, "source-pdos",
-                                            NULL, 0);
+       ret = fwnode_property_count_u32(fwnode, "source-pdos");
        if (ret <= 0)
                return -EINVAL;
 
@@ -4435,8 +4434,7 @@ static int tcpm_fw_get_caps(struct tcpm_port *port,
                return -EINVAL;
 sink:
        /* Get sink pdos */
-       ret = fwnode_property_read_u32_array(fwnode, "sink-pdos",
-                                            NULL, 0);
+       ret = fwnode_property_count_u32(fwnode, "sink-pdos");
        if (ret <= 0)
                return -EINVAL;