linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wentao Liang <vulab@iscas.ac.cn>
To: ludovic.desroches@microchip.com, linus.walleij@linaro.org,
	nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com
Cc: claudiu.beznea@tuxon.dev, linux-arm-kernel@lists.infradead.org,
	linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
	Wentao Liang <vulab@iscas.ac.cn>
Subject: [PATCH] pinctrl: at91: Add error handling for pinctrl_utils_add_map_mux()
Date: Tue, 18 Mar 2025 11:07:17 +0800	[thread overview]
Message-ID: <20250318030717.781-1-vulab@iscas.ac.cn> (raw)

In atmel_pctl_dt_subnode_to_map(), the return value of
pinctrl_utils_add_map_mux() needs to be checked, for the function
will fail to associate group when the group map is full. Add error
handling for pinctrl_utils_add_map_mux() to return immediately and
propagate the error code to caller function when the function fails.

Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
---
 drivers/pinctrl/pinctrl-at91-pio4.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/pinctrl/pinctrl-at91-pio4.c b/drivers/pinctrl/pinctrl-at91-pio4.c
index 8b01d312305a..4dcaebc20d99 100644
--- a/drivers/pinctrl/pinctrl-at91-pio4.c
+++ b/drivers/pinctrl/pinctrl-at91-pio4.c
@@ -609,8 +609,10 @@ static int atmel_pctl_dt_subnode_to_map(struct pinctrl_dev *pctldev,
 		if (ret)
 			goto exit;
 
-		pinctrl_utils_add_map_mux(pctldev, map, reserved_maps, num_maps,
+		ret = pinctrl_utils_add_map_mux(pctldev, map, reserved_maps, num_maps,
 					  group, func);
+		if (ret)
+			goto exit;
 
 		if (num_configs) {
 			ret = pinctrl_utils_add_map_configs(pctldev, map,
-- 
2.42.0.windows.2


             reply	other threads:[~2025-03-18  3:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-18  3:07 Wentao Liang [this message]
2025-03-20 14:48 ` [PATCH] pinctrl: at91: Add error handling for pinctrl_utils_add_map_mux() Markus Elfring
2025-04-10 22:34 ` 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=20250318030717.781-1-vulab@iscas.ac.cn \
    --to=vulab@iscas.ac.cn \
    --cc=alexandre.belloni@bootlin.com \
    --cc=claudiu.beznea@tuxon.dev \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ludovic.desroches@microchip.com \
    --cc=nicolas.ferre@microchip.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).