* [PATCH] pinctrl: at91: Add error handling for pinctrl_utils_add_map_mux()
@ 2025-03-18 3:07 Wentao Liang
2025-03-20 14:48 ` Markus Elfring
2025-04-10 22:34 ` Linus Walleij
0 siblings, 2 replies; 3+ messages in thread
From: Wentao Liang @ 2025-03-18 3:07 UTC (permalink / raw)
To: ludovic.desroches, linus.walleij, nicolas.ferre,
alexandre.belloni
Cc: claudiu.beznea, linux-arm-kernel, linux-gpio, linux-kernel,
Wentao Liang
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
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] pinctrl: at91: Add error handling for pinctrl_utils_add_map_mux()
2025-03-18 3:07 [PATCH] pinctrl: at91: Add error handling for pinctrl_utils_add_map_mux() Wentao Liang
@ 2025-03-20 14:48 ` Markus Elfring
2025-04-10 22:34 ` Linus Walleij
1 sibling, 0 replies; 3+ messages in thread
From: Markus Elfring @ 2025-03-20 14:48 UTC (permalink / raw)
To: vulab, linux-gpio, linux-arm-kernel
Cc: LKML, Alexandre Belloni, Claudiu Beznea, Nicolas Ferre,
Linus Walleij, Ludovic Desroches
> 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. …
Please improve such a change description another bit.
> propagate the error code to caller function when the function fails.
call failed?
How do you think about to add any tags (like “Fixes” and “Cc”) accordingly?
https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.14-rc7#n145
Regards,
Markus
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] pinctrl: at91: Add error handling for pinctrl_utils_add_map_mux()
2025-03-18 3:07 [PATCH] pinctrl: at91: Add error handling for pinctrl_utils_add_map_mux() Wentao Liang
2025-03-20 14:48 ` Markus Elfring
@ 2025-04-10 22:34 ` Linus Walleij
1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2025-04-10 22:34 UTC (permalink / raw)
To: Wentao Liang
Cc: ludovic.desroches, nicolas.ferre, alexandre.belloni,
claudiu.beznea, linux-arm-kernel, linux-gpio, linux-kernel
On Tue, Mar 18, 2025 at 4:07 AM Wentao Liang <vulab@iscas.ac.cn> wrote:
> 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>
Patch applied.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-04-10 22:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-18 3:07 [PATCH] pinctrl: at91: Add error handling for pinctrl_utils_add_map_mux() Wentao Liang
2025-03-20 14:48 ` Markus Elfring
2025-04-10 22:34 ` Linus Walleij
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).