summaryrefslogtreecommitdiff
path: root/drivers/pinctrl/pinconf.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pinctrl/pinconf.c')
-rw-r--r--drivers/pinctrl/pinconf.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/pinctrl/pinconf.c b/drivers/pinctrl/pinconf.c
index 7321e860129..eb3a14f4b86 100644
--- a/drivers/pinctrl/pinconf.c
+++ b/drivers/pinctrl/pinconf.c
@@ -495,6 +495,7 @@ static int pinconf_groups_show(struct seq_file *s, void *what)
struct pinctrl_dev *pctldev = s->private;
const struct pinctrl_ops *pctlops = pctldev->desc->pctlops;
const struct pinconf_ops *ops = pctldev->desc->confops;
+ unsigned ngroups = pctlops->get_groups_count(pctldev);
unsigned selector = 0;
if (!ops || !ops->pin_config_group_get)
@@ -505,7 +506,7 @@ static int pinconf_groups_show(struct seq_file *s, void *what)
mutex_lock(&pinctrl_mutex);
- while (pctlops->list_groups(pctldev, selector) >= 0) {
+ while (selector < ngroups) {
const char *gname = pctlops->get_group_name(pctldev, selector);
seq_printf(s, "%u (%s):", selector, gname);