]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
pinctrl: nuvoton: Convert to use struct pingroup and PINCTRL_PINGROUP()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tue, 18 Mar 2025 10:57:15 +0000 (12:57 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 20 Mar 2025 08:14:10 +0000 (09:14 +0100)
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>
drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c
drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c

index 62a46d824b4659d6f2c4bb4b80bbfba51ad0c4cf..2601aacfb976b7911370d0e1184b440b8c7cb26e 100644 (file)
@@ -504,17 +504,6 @@ static const int lkgpo2_pins[] = { 9 };
 
 static const int nprd_smi_pins[] = { 190 };
 
-/*
- * pin:             name, number
- * group:    name, npins,   pins
- * function: name, ngroups, groups
- */
-struct npcm7xx_group {
-       const char *name;
-       const unsigned int *pins;
-       int npins;
-};
-
 #define NPCM7XX_GRPS \
        NPCM7XX_GRP(smb0), \
        NPCM7XX_GRP(smb0b), \
@@ -642,9 +631,8 @@ enum {
 #undef NPCM7XX_GRP
 };
 
-static struct npcm7xx_group npcm7xx_groups[] = {
-#define NPCM7XX_GRP(x) { .name = #x, .pins = x ## _pins, \
-                       .npins = ARRAY_SIZE(x ## _pins) }
+static struct pingroup npcm7xx_groups[] = {
+#define NPCM7XX_GRP(x) PINCTRL_PINGROUP(#x, x ## _pins, ARRAY_SIZE(x ## _pins))
        NPCM7XX_GRPS
 #undef NPCM7XX_GRP
 };
index 309f66dde309554b79d4369441971841e16e42a0..dcfb58be76321bfdd674f3932ddcff369c3c3fc8 100644 (file)
@@ -587,17 +587,6 @@ static const int hgpio5_pins[] = { 25 };
 static const int hgpio6_pins[] = { 59 };
 static const int hgpio7_pins[] = { 60 };
 
-/*
- * pin:             name, number
- * group:    name, npins,   pins
- * function: name, ngroups, groups
- */
-struct npcm8xx_pingroup {
-       const char *name;
-       const unsigned int *pins;
-       int npins;
-};
-
 #define NPCM8XX_GRPS \
        NPCM8XX_GRP(gpi36), \
        NPCM8XX_GRP(gpi35), \
@@ -829,9 +818,8 @@ enum {
 #undef NPCM8XX_GRP
 };
 
-static struct npcm8xx_pingroup npcm8xx_pingroups[] = {
-#define NPCM8XX_GRP(x) { .name = #x, .pins = x ## _pins, \
-                       .npins = ARRAY_SIZE(x ## _pins) }
+static struct pingroup npcm8xx_pingroups[] = {
+#define NPCM8XX_GRP(x) PINCTRL_PINGROUP(#x, x ## _pins, ARRAY_SIZE(x ## _pins))
        NPCM8XX_GRPS
 #undef NPCM8XX_GRP
 };