Commit 86db3f0d authored by Rob Herring (Arm)'s avatar Rob Herring (Arm) Committed by Linus Walleij
Browse files

pinctrl: Use of_property_present() for non-boolean properties



The use of of_property_read_bool() for non-boolean properties is
deprecated in favor of of_property_present() when testing for property
presence.

Signed-off-by: default avatarRob Herring (Arm) <robh@kernel.org>
Link: https://lore.kernel.org/20241104194437.327430-1-robh@kernel.org


Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 546ee7b8
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -633,11 +633,11 @@ static int imx_pinctrl_parse_functions(struct device_node *np,
static bool imx_pinctrl_dt_is_flat_functions(struct device_node *np)
{
	for_each_child_of_node_scoped(np, function_np) {
		if (of_property_read_bool(function_np, "fsl,pins"))
		if (of_property_present(function_np, "fsl,pins"))
			return true;

		for_each_child_of_node_scoped(function_np, pinctrl_np) {
			if (of_property_read_bool(pinctrl_np, "fsl,pins"))
			if (of_property_present(pinctrl_np, "fsl,pins"))
				return false;
		}
	}
@@ -746,7 +746,7 @@ int imx_pinctrl_probe(struct platform_device *pdev,
		if (IS_ERR(ipctl->base))
			return PTR_ERR(ipctl->base);

		if (of_property_read_bool(dev_np, "fsl,input-sel")) {
		if (of_property_present(dev_np, "fsl,input-sel")) {
			np = of_parse_phandle(dev_np, "fsl,input-sel", 0);
			if (!np) {
				dev_err(&pdev->dev, "iomuxc fsl,input-sel property not found\n");
+1 −1
Original line number Diff line number Diff line
@@ -1524,7 +1524,7 @@ static int pinmux_xway_probe(struct platform_device *pdev)
	 * files which don't set the "gpio-ranges" property or systems that
	 * utilize ACPI the driver has to call gpiochip_add_pin_range().
	 */
	if (!of_property_read_bool(pdev->dev.of_node, "gpio-ranges")) {
	if (!of_property_present(pdev->dev.of_node, "gpio-ranges")) {
		/* finish with registering the gpio range in pinctrl */
		xway_gpio_range.npins = xway_chip.ngpio;
		xway_gpio_range.base = xway_chip.base;
+1 −1
Original line number Diff line number Diff line
@@ -1457,7 +1457,7 @@ static int msm_gpio_init(struct msm_pinctrl *pctrl)
	 * files which don't set the "gpio-ranges" property or systems that
	 * utilize ACPI the driver has to call gpiochip_add_pin_range().
	 */
	if (!of_property_read_bool(pctrl->dev->of_node, "gpio-ranges")) {
	if (!of_property_present(pctrl->dev->of_node, "gpio-ranges")) {
		ret = gpiochip_add_pin_range(&pctrl->chip,
			dev_name(pctrl->dev), 0, 0, chip->ngpio);
		if (ret) {
+1 −1
Original line number Diff line number Diff line
@@ -1169,7 +1169,7 @@ static int pmic_gpio_probe(struct platform_device *pdev)
	 * files which don't set the "gpio-ranges" property or systems that
	 * utilize ACPI the driver has to call gpiochip_add_pin_range().
	 */
	if (!of_property_read_bool(dev->of_node, "gpio-ranges")) {
	if (!of_property_present(dev->of_node, "gpio-ranges")) {
		ret = gpiochip_add_pin_range(&state->chip, dev_name(dev), 0, 0,
					     npins);
		if (ret) {
+1 −1
Original line number Diff line number Diff line
@@ -832,7 +832,7 @@ static int pm8xxx_gpio_probe(struct platform_device *pdev)
	 * files which don't set the "gpio-ranges" property or systems that
	 * utilize ACPI the driver has to call gpiochip_add_pin_range().
	 */
	if (!of_property_read_bool(pctrl->dev->of_node, "gpio-ranges")) {
	if (!of_property_present(pctrl->dev->of_node, "gpio-ranges")) {
		ret = gpiochip_add_pin_range(&pctrl->chip, dev_name(pctrl->dev),
					     0, 0, pctrl->chip.ngpio);
		if (ret) {