Skip to content

Commit 1a65846

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. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/20250318105932.2090926-3-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
1 parent 113ec87 commit 1a65846

File tree

2 files changed

+4
-28
lines changed

2 files changed

+4
-28
lines changed

drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -504,17 +504,6 @@ static const int lkgpo2_pins[] = { 9 };
504504

505505
static const int nprd_smi_pins[] = { 190 };
506506

507-
/*
508-
* pin: name, number
509-
* group: name, npins, pins
510-
* function: name, ngroups, groups
511-
*/
512-
struct npcm7xx_group {
513-
const char *name;
514-
const unsigned int *pins;
515-
int npins;
516-
};
517-
518507
#define NPCM7XX_GRPS \
519508
NPCM7XX_GRP(smb0), \
520509
NPCM7XX_GRP(smb0b), \
@@ -642,9 +631,8 @@ enum {
642631
#undef NPCM7XX_GRP
643632
};
644633

645-
static struct npcm7xx_group npcm7xx_groups[] = {
646-
#define NPCM7XX_GRP(x) { .name = #x, .pins = x ## _pins, \
647-
.npins = ARRAY_SIZE(x ## _pins) }
634+
static struct pingroup npcm7xx_groups[] = {
635+
#define NPCM7XX_GRP(x) PINCTRL_PINGROUP(#x, x ## _pins, ARRAY_SIZE(x ## _pins))
648636
NPCM7XX_GRPS
649637
#undef NPCM7XX_GRP
650638
};

drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -587,17 +587,6 @@ static const int hgpio5_pins[] = { 25 };
587587
static const int hgpio6_pins[] = { 59 };
588588
static const int hgpio7_pins[] = { 60 };
589589

590-
/*
591-
* pin: name, number
592-
* group: name, npins, pins
593-
* function: name, ngroups, groups
594-
*/
595-
struct npcm8xx_pingroup {
596-
const char *name;
597-
const unsigned int *pins;
598-
int npins;
599-
};
600-
601590
#define NPCM8XX_GRPS \
602591
NPCM8XX_GRP(gpi36), \
603592
NPCM8XX_GRP(gpi35), \
@@ -829,9 +818,8 @@ enum {
829818
#undef NPCM8XX_GRP
830819
};
831820

832-
static struct npcm8xx_pingroup npcm8xx_pingroups[] = {
833-
#define NPCM8XX_GRP(x) { .name = #x, .pins = x ## _pins, \
834-
.npins = ARRAY_SIZE(x ## _pins) }
821+
static struct pingroup npcm8xx_pingroups[] = {
822+
#define NPCM8XX_GRP(x) PINCTRL_PINGROUP(#x, x ## _pins, ARRAY_SIZE(x ## _pins))
835823
NPCM8XX_GRPS
836824
#undef NPCM8XX_GRP
837825
};

0 commit comments

Comments
 (0)