summaryrefslogtreecommitdiff
path: root/drivers/pinctrl/core.c
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2023-12-11 21:57:57 +0300
committerLinus Walleij <linus.walleij@linaro.org>2023-12-12 02:47:52 +0300
commit85174ad7c30fca29a354221e01fad82c0d00d644 (patch)
treee205b29bcd1466b81713395d9b3b06eb01c9cb43 /drivers/pinctrl/core.c
parentb0f24e021d58d74b83857b9d5c468bcda3785572 (diff)
downloadlinux-85174ad7c30fca29a354221e01fad82c0d00d644.tar.xz
pinctrl: core: Embed struct pingroup into struct group_desc
struct group_desc is a particular version of the struct pingroup with associated opaque data. Start switching pin control core and drivers to use it explicitly. Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20231211190321.307330-5-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/core.c')
-rw-r--r--drivers/pinctrl/core.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c
index 540221dc5617..8a457b512706 100644
--- a/drivers/pinctrl/core.c
+++ b/drivers/pinctrl/core.c
@@ -557,7 +557,10 @@ const char *pinctrl_generic_get_group_name(struct pinctrl_dev *pctldev,
if (!group)
return NULL;
- return group->name;
+ if (group->name)
+ return group->name;
+
+ return group->grp.name;
}
EXPORT_SYMBOL_GPL(pinctrl_generic_get_group_name);
@@ -583,8 +586,14 @@ int pinctrl_generic_get_group_pins(struct pinctrl_dev *pctldev,
return -EINVAL;
}
- *pins = group->pins;
- *num_pins = group->num_pins;
+ if (group->pins) {
+ *pins = group->pins;
+ *num_pins = group->num_pins;
+ return 0;
+ }
+
+ *pins = group->grp.pins;
+ *num_pins = group->grp.npins;
return 0;
}