Skip to content

Commit e64c0ff

Browse files
jason77-wanglinusw
authored andcommitted
pinctrl: imx: Return NULL if no group is matched and found
Currently if no group is matched and found, this function will return the last grp to the caller, this is not expected, it is supposed to return NULL in this case. Fixes: e566fc1 ("pinctrl: imx: use generic pinctrl helpers for managing groups") Signed-off-by: Hui Wang <hui.wang@canonical.com> Reviewed-by: Frank Li <Frank.Li@nxp.com> Link: https://lore.kernel.org/20250327031600.99723-1-hui.wang@canonical.com Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
1 parent 0af2f6b commit e64c0ff

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/pinctrl/freescale/pinctrl-imx.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,16 @@ static inline const struct group_desc *imx_pinctrl_find_group_by_name(
3737
struct pinctrl_dev *pctldev,
3838
const char *name)
3939
{
40-
const struct group_desc *grp = NULL;
40+
const struct group_desc *grp;
4141
int i;
4242

4343
for (i = 0; i < pctldev->num_groups; i++) {
4444
grp = pinctrl_generic_get_group(pctldev, i);
4545
if (grp && !strcmp(grp->grp.name, name))
46-
break;
46+
return grp;
4747
}
4848

49-
return grp;
49+
return NULL;
5050
}
5151

5252
static void imx_pin_dbg_show(struct pinctrl_dev *pctldev, struct seq_file *s,

0 commit comments

Comments
 (0)