Commit 9d7ebbbf authored by Ludovic Desroches's avatar Ludovic Desroches Committed by Linus Walleij

pinctrl: don't print unavailable function groups

There is no reason to try to print groups associated to a function if
get_function_groups returns an error. Moreover, it can lead to a NULL
pointer dereference error.
Signed-off-by: default avatarLudovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 1bb6fad3
...@@ -557,9 +557,12 @@ static int pinmux_functions_show(struct seq_file *s, void *what) ...@@ -557,9 +557,12 @@ static int pinmux_functions_show(struct seq_file *s, void *what)
ret = pmxops->get_function_groups(pctldev, func_selector, ret = pmxops->get_function_groups(pctldev, func_selector,
&groups, &num_groups); &groups, &num_groups);
if (ret) if (ret) {
seq_printf(s, "function %s: COULD NOT GET GROUPS\n", seq_printf(s, "function %s: COULD NOT GET GROUPS\n",
func); func);
func_selector++;
continue;
}
seq_printf(s, "function: %s, groups = [ ", func); seq_printf(s, "function: %s, groups = [ ", func);
for (i = 0; i < num_groups; i++) for (i = 0; i < num_groups; i++)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment