Skip to content

Commit 583b527

Browse files
andy-shevlinusw
authored andcommitted
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: Jonathan Neuschäfer <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Linus Walleij <[email protected]>
1 parent 3859a6f commit 583b527

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

drivers/pinctrl/nuvoton/pinctrl-wpcm450.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -474,9 +474,8 @@ enum {
474474
#undef WPCM450_GRP
475475
};
476476

477-
static struct group_desc wpcm450_groups[] = {
478-
#define WPCM450_GRP(x) { .name = #x, .pins = x ## _pins, \
479-
.num_pins = ARRAY_SIZE(x ## _pins) }
477+
static struct pingroup wpcm450_groups[] = {
478+
#define WPCM450_GRP(x) PINCTRL_PINGROUP(#x, x ## _pins, ARRAY_SIZE(x ## _pins))
480479
WPCM450_GRPS
481480
#undef WPCM450_GRP
482481
};
@@ -852,7 +851,7 @@ static int wpcm450_get_group_pins(struct pinctrl_dev *pctldev,
852851
const unsigned int **pins,
853852
unsigned int *npins)
854853
{
855-
*npins = wpcm450_groups[selector].num_pins;
854+
*npins = wpcm450_groups[selector].npins;
856855
*pins = wpcm450_groups[selector].pins;
857856

858857
return 0;
@@ -901,7 +900,7 @@ static int wpcm450_pinmux_set_mux(struct pinctrl_dev *pctldev,
901900
struct wpcm450_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev);
902901

903902
wpcm450_setfunc(pctrl->gcr_regmap, wpcm450_groups[group].pins,
904-
wpcm450_groups[group].num_pins, function);
903+
wpcm450_groups[group].npins, function);
905904

906905
return 0;
907906
}

0 commit comments

Comments
 (0)