]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
pinctrl: renesas: Use int type to store negative error codes
authorQianfeng Rong <rongqianfeng@vivo.com>
Sun, 31 Aug 2025 08:49:58 +0000 (16:49 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 Oct 2025 09:56:27 +0000 (11:56 +0200)
[ Upstream commit 9f062fc5b0ff44550088912ab89f9da40226a826 ]

Change the 'ret' variable in sh_pfc_pinconf_group_set() from unsigned
int to int, as it needs to store either negative error codes or zero
returned by sh_pfc_pinconf_set().

No effect on runtime.

Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com>
Fixes: d0593c363f04ccc4 ("pinctrl: sh-pfc: Propagate errors on group config")
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/20250831084958.431913-4-rongqianfeng@vivo.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/pinctrl/renesas/pinctrl.c

index b438d24c13b5c9110d7ad772e485cc16acccffc0..ea2fbabe1c64b3a938d30a4e7175bf38ded89693 100644 (file)
@@ -747,7 +747,8 @@ static int sh_pfc_pinconf_group_set(struct pinctrl_dev *pctldev, unsigned group,
        struct sh_pfc_pinctrl *pmx = pinctrl_dev_get_drvdata(pctldev);
        const unsigned int *pins;
        unsigned int num_pins;
-       unsigned int i, ret;
+       unsigned int i;
+       int ret;
 
        pins = pmx->pfc->info->groups[group].pins;
        num_pins = pmx->pfc->info->groups[group].nr_pins;