Commit 583b5273 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Linus Walleij

pinctrl: nuvoton: Convert to use struct pingroup and PINCTRL_PINGROUP()

The pin control header provides struct pingroup and PINCTRL_PINGROUP() macro.
Utilize them instead of open coded variants in the driver.
Reviewed-by: default avatarJonathan Neuschäfer <j.neuschaefer@gmx.net>
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20231204160033.1872569-6-andriy.shevchenko@linux.intel.comSigned-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 3859a6fd
...@@ -474,9 +474,8 @@ enum { ...@@ -474,9 +474,8 @@ enum {
#undef WPCM450_GRP #undef WPCM450_GRP
}; };
static struct group_desc wpcm450_groups[] = { static struct pingroup wpcm450_groups[] = {
#define WPCM450_GRP(x) { .name = #x, .pins = x ## _pins, \ #define WPCM450_GRP(x) PINCTRL_PINGROUP(#x, x ## _pins, ARRAY_SIZE(x ## _pins))
.num_pins = ARRAY_SIZE(x ## _pins) }
WPCM450_GRPS WPCM450_GRPS
#undef WPCM450_GRP #undef WPCM450_GRP
}; };
...@@ -852,7 +851,7 @@ static int wpcm450_get_group_pins(struct pinctrl_dev *pctldev, ...@@ -852,7 +851,7 @@ static int wpcm450_get_group_pins(struct pinctrl_dev *pctldev,
const unsigned int **pins, const unsigned int **pins,
unsigned int *npins) unsigned int *npins)
{ {
*npins = wpcm450_groups[selector].num_pins; *npins = wpcm450_groups[selector].npins;
*pins = wpcm450_groups[selector].pins; *pins = wpcm450_groups[selector].pins;
return 0; return 0;
...@@ -901,7 +900,7 @@ static int wpcm450_pinmux_set_mux(struct pinctrl_dev *pctldev, ...@@ -901,7 +900,7 @@ static int wpcm450_pinmux_set_mux(struct pinctrl_dev *pctldev,
struct wpcm450_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); struct wpcm450_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev);
wpcm450_setfunc(pctrl->gcr_regmap, wpcm450_groups[group].pins, wpcm450_setfunc(pctrl->gcr_regmap, wpcm450_groups[group].pins,
wpcm450_groups[group].num_pins, function); wpcm450_groups[group].npins, function);
return 0; return 0;
} }
......
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