All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joey Gouly <joey.gouly@arm.com>
To: <linux-gpio@vger.kernel.org>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	Andy Shevchenko <andy.shevchenko@gmail.com>,
	Hector Martin <marcan@marcan.st>, <nd@arm.com>,
	Joey Gouly <joey.gouly@arm.com>
Subject: [PATCH v2 11/11] pinctrl: apple: return an error if pinmux is missing in the DT
Date: Sun, 21 Nov 2021 16:56:42 +0000	[thread overview]
Message-ID: <20211121165642.27883-12-joey.gouly@arm.com> (raw)
In-Reply-To: <20211121165642.27883-1-joey.gouly@arm.com>

If of_property_count_u32_elems returned 0, return -EINVAL to indicate
a failure. Previously this would return 0.

Fixes: a0f160ffcb83 ("pinctrl: add pinctrl/GPIO driver for Apple SoCs")
Signed-off-by: Joey Gouly <joey.gouly@arm.com>
Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
---
 drivers/pinctrl/pinctrl-apple-gpio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pinctrl/pinctrl-apple-gpio.c b/drivers/pinctrl/pinctrl-apple-gpio.c
index 8a58c862c33a..89602aa14c6a 100644
--- a/drivers/pinctrl/pinctrl-apple-gpio.c
+++ b/drivers/pinctrl/pinctrl-apple-gpio.c
@@ -119,7 +119,7 @@ static int apple_gpio_dt_node_to_map(struct pinctrl_dev *pctldev,
 		dev_err(pctl->dev,
 			"missing or empty pinmux property in node %pOFn.\n",
 			node);
-		return ret;
+		return ret ? ret : -EINVAL;
 	}
 
 	num_pins = ret;
-- 
2.17.1


  parent reply	other threads:[~2021-11-21 16:58 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-21 16:56 [PATCH v2 00/11] pinctrl: apple: misc fixes from post-commit review Joey Gouly
2021-11-21 16:56 ` [PATCH v2 01/11] pinctrl: apple: fix some formatting issues Joey Gouly
2021-11-21 16:56 ` [PATCH v2 02/11] pinctrl: apple: add missing comma Joey Gouly
2021-11-21 16:56 ` [PATCH v2 03/11] pinctrl: apple: use C style comment Joey Gouly
2021-11-21 16:56 ` [PATCH v2 04/11] pinctrl: apple: add missing bits.h header Joey Gouly
2021-11-21 16:56 ` [PATCH v2 05/11] pinctrl: apple: handle regmap_read errors Joey Gouly
2021-11-21 16:56 ` [PATCH v2 06/11] pinctrl: apple: make apple_gpio_get_direction more readable Joey Gouly
2021-11-21 16:56 ` [PATCH v2 07/11] pinctrl: apple: give error label a specific name Joey Gouly
2021-11-21 16:56 ` [PATCH v2 08/11] pinctrl: apple: remove gpio-controller check Joey Gouly
2021-11-21 16:56 ` [PATCH v2 09/11] pinctrl: apple: don't set gpio_chip.of_node Joey Gouly
2021-11-21 16:56 ` [PATCH v2 10/11] pinctrl: apple: use modulo rather than bitwise and Joey Gouly
2021-11-21 16:56 ` Joey Gouly [this message]
2021-11-22  0:15 ` [PATCH v2 00/11] pinctrl: apple: misc fixes from post-commit review Linus Walleij
2021-11-26  0:53   ` Linus Walleij
2021-11-26 22:30     ` Joey Gouly
2021-11-27  0:01       ` Linus Walleij

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211121165642.27883-12-joey.gouly@arm.com \
    --to=joey.gouly@arm.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=marcan@marcan.st \
    --cc=nd@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.