Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 720b8ec6 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Linus Walleij
Browse files

pinctrl: msm: Switch to use device_property_count_uXX()



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

Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20190723192738.68486-1-andriy.shevchenko@linux.intel.com


Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent a1db8da7
Loading
Loading
Loading
Loading
+2 −3
Original line number Original line Diff line number Diff line
@@ -617,8 +617,7 @@ static int msm_gpio_init_valid_mask(struct gpio_chip *chip)
	}
	}


	/* The number of GPIOs in the ACPI tables */
	/* The number of GPIOs in the ACPI tables */
	len = ret = device_property_read_u16_array(pctrl->dev, "gpios", NULL,
	len = ret = device_property_count_u16(pctrl->dev, "gpios");
						   0);
	if (ret < 0)
	if (ret < 0)
		return 0;
		return 0;


@@ -996,7 +995,7 @@ static bool msm_gpio_needs_valid_mask(struct msm_pinctrl *pctrl)
	if (pctrl->soc->reserved_gpios)
	if (pctrl->soc->reserved_gpios)
		return true;
		return true;


	return device_property_read_u16_array(pctrl->dev, "gpios", NULL, 0) > 0;
	return device_property_count_u16(pctrl->dev, "gpios") > 0;
}
}


static int msm_gpio_init(struct msm_pinctrl *pctrl)
static int msm_gpio_init(struct msm_pinctrl *pctrl)