The struct group_desc has a lot of duplication with struct pingroup.
Deduplicate that by embeddind the latter in the former and convert
users.
Linus, assuming everything is fine, I can push this to my tree.
Or you can apply it (assumming all CIs and people are happy with
the series).
NB. This series contains previously sent patches for Qualcomm and
Nuovoton. Here the updated version for Qualcomm that splits previous
patch to two and fixes compilation warnings.
NB. The function_desc is in plan to follow the similar deduplication.
In v2:
- added a few patches to fix multiple compile-time errors (LKP)
- added tag (Jonathan)
v1: https://lore.kernel.org/r/[email protected]
Andy Shevchenko (21):
pinctrl: qcom: lpass-lpi: Replace kernel.h with what is being used
pinctrl: qcom: lpass-lpi: Remove unused member in struct lpi_pingroup
pinctrl: equilibrium: Use temporary variable to hold pins
pinctrl: imx: Use temporary variable to hold pins
pinctrl: core: Make pins const in struct group_desc
pinctrl: equilibrium: Convert to use struct pingroup
pinctrl: keembay: Convert to use struct pingroup
pinctrl: nuvoton: Convert to use struct pingroup and
PINCTRL_PINGROUP()
pinctrl: core: Add a convenient define PINCTRL_GROUP_DESC()
pinctrl: ingenic: Make use of PINCTRL_GROUP_DESC()
pinctrl: mediatek: Make use of PINCTRL_GROUP_DESC()
pinctrl: core: Embed struct pingroup into struct group_desc
pinctrl: bcm: Convert to use grp member
pinctrl: equilibrium: Convert to use grp member
pinctrl: imx: Convert to use grp member
pinctrl: ingenic: Convert to use grp member
pinctrl: keembay: Convert to use grp member
pinctrl: mediatek: Convert to use grp member
pinctrl: renesas: Convert to use grp member
pinctrl: starfive: Convert to use grp member
pinctrl: core: Remove unused members from struct group_desc
drivers/pinctrl/bcm/pinctrl-ns.c | 4 +-
drivers/pinctrl/core.c | 13 +++---
drivers/pinctrl/core.h | 19 +++++---
drivers/pinctrl/freescale/pinctrl-imx.c | 44 +++++++++----------
drivers/pinctrl/mediatek/pinctrl-moore.c | 13 +++---
drivers/pinctrl/mediatek/pinctrl-moore.h | 7 +--
drivers/pinctrl/mediatek/pinctrl-paris.h | 7 +--
drivers/pinctrl/nuvoton/pinctrl-wpcm450.c | 9 ++--
drivers/pinctrl/pinctrl-equilibrium.c | 39 ++++++++--------
drivers/pinctrl/pinctrl-ingenic.c | 27 +++++-------
drivers/pinctrl/pinctrl-keembay.c | 6 +--
drivers/pinctrl/qcom/pinctrl-lpass-lpi.h | 6 +--
.../pinctrl/qcom/pinctrl-sc7280-lpass-lpi.c | 16 -------
.../pinctrl/qcom/pinctrl-sc8280xp-lpass-lpi.c | 20 ---------
.../pinctrl/qcom/pinctrl-sm6115-lpass-lpi.c | 20 ---------
.../pinctrl/qcom/pinctrl-sm8250-lpass-lpi.c | 15 -------
.../pinctrl/qcom/pinctrl-sm8350-lpass-lpi.c | 16 -------
.../pinctrl/qcom/pinctrl-sm8450-lpass-lpi.c | 24 ----------
.../pinctrl/qcom/pinctrl-sm8550-lpass-lpi.c | 24 ----------
.../pinctrl/qcom/pinctrl-sm8650-lpass-lpi.c | 24 ----------
drivers/pinctrl/renesas/pinctrl-rza1.c | 2 +-
drivers/pinctrl/renesas/pinctrl-rza2.c | 10 ++---
drivers/pinctrl/renesas/pinctrl-rzg2l.c | 6 +--
drivers/pinctrl/renesas/pinctrl-rzv2m.c | 6 +--
.../starfive/pinctrl-starfive-jh7100.c | 8 ++--
.../starfive/pinctrl-starfive-jh7110.c | 8 ++--
26 files changed, 106 insertions(+), 287 deletions(-)
--
2.43.0.rc1.1.gbec44491f096
The group is not used anywhere, remove it. And if needed, it should be
struct pingroup anyway.
Signed-off-by: Andy Shevchenko <[email protected]>
---
drivers/pinctrl/qcom/pinctrl-lpass-lpi.h | 4 ----
.../pinctrl/qcom/pinctrl-sc7280-lpass-lpi.c | 16 -------------
.../pinctrl/qcom/pinctrl-sc8280xp-lpass-lpi.c | 20 ----------------
.../pinctrl/qcom/pinctrl-sm6115-lpass-lpi.c | 20 ----------------
.../pinctrl/qcom/pinctrl-sm8250-lpass-lpi.c | 15 ------------
.../pinctrl/qcom/pinctrl-sm8350-lpass-lpi.c | 16 -------------
.../pinctrl/qcom/pinctrl-sm8450-lpass-lpi.c | 24 -------------------
.../pinctrl/qcom/pinctrl-sm8550-lpass-lpi.c | 24 -------------------
.../pinctrl/qcom/pinctrl-sm8650-lpass-lpi.c | 24 -------------------
9 files changed, 163 deletions(-)
diff --git a/drivers/pinctrl/qcom/pinctrl-lpass-lpi.h b/drivers/pinctrl/qcom/pinctrl-lpass-lpi.h
index 2017bc80314d..a9b2f65c1ebe 100644
--- a/drivers/pinctrl/qcom/pinctrl-lpass-lpi.h
+++ b/drivers/pinctrl/qcom/pinctrl-lpass-lpi.h
@@ -45,11 +45,8 @@ struct pinctrl_pin_desc;
#define LPI_PINGROUP(id, soff, f1, f2, f3, f4) \
{ \
- .group.name = "gpio" #id, \
- .group.pins = gpio##id##_pins, \
.pin = id, \
.slew_offset = soff, \
- .group.num_pins = ARRAY_SIZE(gpio##id##_pins), \
.funcs = (int[]){ \
LPI_MUX_gpio, \
LPI_MUX_##f1, \
@@ -67,7 +64,6 @@ struct pinctrl_pin_desc;
#define LPI_FLAG_SLEW_RATE_SAME_REG BIT(0)
struct lpi_pingroup {
- struct group_desc group;
unsigned int pin;
/* Bit offset in slew register for SoundWire pins only */
int slew_offset;
diff --git a/drivers/pinctrl/qcom/pinctrl-sc7280-lpass-lpi.c b/drivers/pinctrl/qcom/pinctrl-sc7280-lpass-lpi.c
index 99156217c6a5..6bb39812e1d8 100644
--- a/drivers/pinctrl/qcom/pinctrl-sc7280-lpass-lpi.c
+++ b/drivers/pinctrl/qcom/pinctrl-sc7280-lpass-lpi.c
@@ -36,22 +36,6 @@ enum lpass_lpi_functions {
LPI_MUX__,
};
-static int gpio0_pins[] = { 0 };
-static int gpio1_pins[] = { 1 };
-static int gpio2_pins[] = { 2 };
-static int gpio3_pins[] = { 3 };
-static int gpio4_pins[] = { 4 };
-static int gpio5_pins[] = { 5 };
-static int gpio6_pins[] = { 6 };
-static int gpio7_pins[] = { 7 };
-static int gpio8_pins[] = { 8 };
-static int gpio9_pins[] = { 9 };
-static int gpio10_pins[] = { 10 };
-static int gpio11_pins[] = { 11 };
-static int gpio12_pins[] = { 12 };
-static int gpio13_pins[] = { 13 };
-static int gpio14_pins[] = { 14 };
-
static const struct pinctrl_pin_desc sc7280_lpi_pins[] = {
PINCTRL_PIN(0, "gpio0"),
PINCTRL_PIN(1, "gpio1"),
diff --git a/drivers/pinctrl/qcom/pinctrl-sc8280xp-lpass-lpi.c b/drivers/pinctrl/qcom/pinctrl-sc8280xp-lpass-lpi.c
index b33483056f42..c0369baf3398 100644
--- a/drivers/pinctrl/qcom/pinctrl-sc8280xp-lpass-lpi.c
+++ b/drivers/pinctrl/qcom/pinctrl-sc8280xp-lpass-lpi.c
@@ -45,26 +45,6 @@ enum lpass_lpi_functions {
LPI_MUX__,
};
-static int gpio0_pins[] = { 0 };
-static int gpio1_pins[] = { 1 };
-static int gpio2_pins[] = { 2 };
-static int gpio3_pins[] = { 3 };
-static int gpio4_pins[] = { 4 };
-static int gpio5_pins[] = { 5 };
-static int gpio6_pins[] = { 6 };
-static int gpio7_pins[] = { 7 };
-static int gpio8_pins[] = { 8 };
-static int gpio9_pins[] = { 9 };
-static int gpio10_pins[] = { 10 };
-static int gpio11_pins[] = { 11 };
-static int gpio12_pins[] = { 12 };
-static int gpio13_pins[] = { 13 };
-static int gpio14_pins[] = { 14 };
-static int gpio15_pins[] = { 15 };
-static int gpio16_pins[] = { 16 };
-static int gpio17_pins[] = { 17 };
-static int gpio18_pins[] = { 18 };
-
static const struct pinctrl_pin_desc sc8280xp_lpi_pins[] = {
PINCTRL_PIN(0, "gpio0"),
PINCTRL_PIN(1, "gpio1"),
diff --git a/drivers/pinctrl/qcom/pinctrl-sm6115-lpass-lpi.c b/drivers/pinctrl/qcom/pinctrl-sm6115-lpass-lpi.c
index e8a6f6f6af54..316d6fc69131 100644
--- a/drivers/pinctrl/qcom/pinctrl-sm6115-lpass-lpi.c
+++ b/drivers/pinctrl/qcom/pinctrl-sm6115-lpass-lpi.c
@@ -36,26 +36,6 @@ enum lpass_lpi_functions {
LPI_MUX__,
};
-static int gpio0_pins[] = { 0 };
-static int gpio1_pins[] = { 1 };
-static int gpio2_pins[] = { 2 };
-static int gpio3_pins[] = { 3 };
-static int gpio4_pins[] = { 4 };
-static int gpio5_pins[] = { 5 };
-static int gpio6_pins[] = { 6 };
-static int gpio7_pins[] = { 7 };
-static int gpio8_pins[] = { 8 };
-static int gpio9_pins[] = { 9 };
-static int gpio10_pins[] = { 10 };
-static int gpio11_pins[] = { 11 };
-static int gpio12_pins[] = { 12 };
-static int gpio13_pins[] = { 13 };
-static int gpio14_pins[] = { 14 };
-static int gpio15_pins[] = { 15 };
-static int gpio16_pins[] = { 16 };
-static int gpio17_pins[] = { 17 };
-static int gpio18_pins[] = { 18 };
-
static const struct pinctrl_pin_desc sm6115_lpi_pins[] = {
PINCTRL_PIN(0, "gpio0"),
PINCTRL_PIN(1, "gpio1"),
diff --git a/drivers/pinctrl/qcom/pinctrl-sm8250-lpass-lpi.c b/drivers/pinctrl/qcom/pinctrl-sm8250-lpass-lpi.c
index cb10ce8d5d28..9791d9ba5087 100644
--- a/drivers/pinctrl/qcom/pinctrl-sm8250-lpass-lpi.c
+++ b/drivers/pinctrl/qcom/pinctrl-sm8250-lpass-lpi.c
@@ -36,21 +36,6 @@ enum lpass_lpi_functions {
LPI_MUX__,
};
-static int gpio0_pins[] = { 0 };
-static int gpio1_pins[] = { 1 };
-static int gpio2_pins[] = { 2 };
-static int gpio3_pins[] = { 3 };
-static int gpio4_pins[] = { 4 };
-static int gpio5_pins[] = { 5 };
-static int gpio6_pins[] = { 6 };
-static int gpio7_pins[] = { 7 };
-static int gpio8_pins[] = { 8 };
-static int gpio9_pins[] = { 9 };
-static int gpio10_pins[] = { 10 };
-static int gpio11_pins[] = { 11 };
-static int gpio12_pins[] = { 12 };
-static int gpio13_pins[] = { 13 };
-
static const struct pinctrl_pin_desc sm8250_lpi_pins[] = {
PINCTRL_PIN(0, "gpio0"),
PINCTRL_PIN(1, "gpio1"),
diff --git a/drivers/pinctrl/qcom/pinctrl-sm8350-lpass-lpi.c b/drivers/pinctrl/qcom/pinctrl-sm8350-lpass-lpi.c
index 297cc95ac3c0..5b9a2cb216bd 100644
--- a/drivers/pinctrl/qcom/pinctrl-sm8350-lpass-lpi.c
+++ b/drivers/pinctrl/qcom/pinctrl-sm8350-lpass-lpi.c
@@ -36,22 +36,6 @@ enum lpass_lpi_functions {
LPI_MUX__,
};
-static int gpio0_pins[] = { 0 };
-static int gpio1_pins[] = { 1 };
-static int gpio2_pins[] = { 2 };
-static int gpio3_pins[] = { 3 };
-static int gpio4_pins[] = { 4 };
-static int gpio5_pins[] = { 5 };
-static int gpio6_pins[] = { 6 };
-static int gpio7_pins[] = { 7 };
-static int gpio8_pins[] = { 8 };
-static int gpio9_pins[] = { 9 };
-static int gpio10_pins[] = { 10 };
-static int gpio11_pins[] = { 11 };
-static int gpio12_pins[] = { 12 };
-static int gpio13_pins[] = { 13 };
-static int gpio14_pins[] = { 14 };
-
static const struct pinctrl_pin_desc sm8350_lpi_pins[] = {
PINCTRL_PIN(0, "gpio0"),
PINCTRL_PIN(1, "gpio1"),
diff --git a/drivers/pinctrl/qcom/pinctrl-sm8450-lpass-lpi.c b/drivers/pinctrl/qcom/pinctrl-sm8450-lpass-lpi.c
index 2e7896791fc0..a028cbb49947 100644
--- a/drivers/pinctrl/qcom/pinctrl-sm8450-lpass-lpi.c
+++ b/drivers/pinctrl/qcom/pinctrl-sm8450-lpass-lpi.c
@@ -52,30 +52,6 @@ enum lpass_lpi_functions {
LPI_MUX__,
};
-static int gpio0_pins[] = { 0 };
-static int gpio1_pins[] = { 1 };
-static int gpio2_pins[] = { 2 };
-static int gpio3_pins[] = { 3 };
-static int gpio4_pins[] = { 4 };
-static int gpio5_pins[] = { 5 };
-static int gpio6_pins[] = { 6 };
-static int gpio7_pins[] = { 7 };
-static int gpio8_pins[] = { 8 };
-static int gpio9_pins[] = { 9 };
-static int gpio10_pins[] = { 10 };
-static int gpio11_pins[] = { 11 };
-static int gpio12_pins[] = { 12 };
-static int gpio13_pins[] = { 13 };
-static int gpio14_pins[] = { 14 };
-static int gpio15_pins[] = { 15 };
-static int gpio16_pins[] = { 16 };
-static int gpio17_pins[] = { 17 };
-static int gpio18_pins[] = { 18 };
-static int gpio19_pins[] = { 19 };
-static int gpio20_pins[] = { 20 };
-static int gpio21_pins[] = { 21 };
-static int gpio22_pins[] = { 22 };
-
static const struct pinctrl_pin_desc sm8450_lpi_pins[] = {
PINCTRL_PIN(0, "gpio0"),
PINCTRL_PIN(1, "gpio1"),
diff --git a/drivers/pinctrl/qcom/pinctrl-sm8550-lpass-lpi.c b/drivers/pinctrl/qcom/pinctrl-sm8550-lpass-lpi.c
index 64458c3fbe5e..852192b044e1 100644
--- a/drivers/pinctrl/qcom/pinctrl-sm8550-lpass-lpi.c
+++ b/drivers/pinctrl/qcom/pinctrl-sm8550-lpass-lpi.c
@@ -52,30 +52,6 @@ enum lpass_lpi_functions {
LPI_MUX__,
};
-static int gpio0_pins[] = { 0 };
-static int gpio1_pins[] = { 1 };
-static int gpio2_pins[] = { 2 };
-static int gpio3_pins[] = { 3 };
-static int gpio4_pins[] = { 4 };
-static int gpio5_pins[] = { 5 };
-static int gpio6_pins[] = { 6 };
-static int gpio7_pins[] = { 7 };
-static int gpio8_pins[] = { 8 };
-static int gpio9_pins[] = { 9 };
-static int gpio10_pins[] = { 10 };
-static int gpio11_pins[] = { 11 };
-static int gpio12_pins[] = { 12 };
-static int gpio13_pins[] = { 13 };
-static int gpio14_pins[] = { 14 };
-static int gpio15_pins[] = { 15 };
-static int gpio16_pins[] = { 16 };
-static int gpio17_pins[] = { 17 };
-static int gpio18_pins[] = { 18 };
-static int gpio19_pins[] = { 19 };
-static int gpio20_pins[] = { 20 };
-static int gpio21_pins[] = { 21 };
-static int gpio22_pins[] = { 22 };
-
static const struct pinctrl_pin_desc sm8550_lpi_pins[] = {
PINCTRL_PIN(0, "gpio0"),
PINCTRL_PIN(1, "gpio1"),
diff --git a/drivers/pinctrl/qcom/pinctrl-sm8650-lpass-lpi.c b/drivers/pinctrl/qcom/pinctrl-sm8650-lpass-lpi.c
index 6e4be91ff085..04400c832327 100644
--- a/drivers/pinctrl/qcom/pinctrl-sm8650-lpass-lpi.c
+++ b/drivers/pinctrl/qcom/pinctrl-sm8650-lpass-lpi.c
@@ -54,30 +54,6 @@ enum lpass_lpi_functions {
LPI_MUX__,
};
-static int gpio0_pins[] = { 0 };
-static int gpio1_pins[] = { 1 };
-static int gpio2_pins[] = { 2 };
-static int gpio3_pins[] = { 3 };
-static int gpio4_pins[] = { 4 };
-static int gpio5_pins[] = { 5 };
-static int gpio6_pins[] = { 6 };
-static int gpio7_pins[] = { 7 };
-static int gpio8_pins[] = { 8 };
-static int gpio9_pins[] = { 9 };
-static int gpio10_pins[] = { 10 };
-static int gpio11_pins[] = { 11 };
-static int gpio12_pins[] = { 12 };
-static int gpio13_pins[] = { 13 };
-static int gpio14_pins[] = { 14 };
-static int gpio15_pins[] = { 15 };
-static int gpio16_pins[] = { 16 };
-static int gpio17_pins[] = { 17 };
-static int gpio18_pins[] = { 18 };
-static int gpio19_pins[] = { 19 };
-static int gpio20_pins[] = { 20 };
-static int gpio21_pins[] = { 21 };
-static int gpio22_pins[] = { 22 };
-
static const struct pinctrl_pin_desc sm8650_lpi_pins[] = {
PINCTRL_PIN(0, "gpio0"),
PINCTRL_PIN(1, "gpio1"),
--
2.43.0.rc1.1.gbec44491f096
Make use of PINCTRL_GROUP_DESC() instead of open coding it.
Signed-off-by: Andy Shevchenko <[email protected]>
---
drivers/pinctrl/pinctrl-ingenic.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/drivers/pinctrl/pinctrl-ingenic.c b/drivers/pinctrl/pinctrl-ingenic.c
index ee718f6e2556..393873de910a 100644
--- a/drivers/pinctrl/pinctrl-ingenic.c
+++ b/drivers/pinctrl/pinctrl-ingenic.c
@@ -83,15 +83,10 @@
#define JZ4730_PINS_PER_PAIRED_REG 16
#define INGENIC_PIN_GROUP_FUNCS(name, id, funcs) \
- { \
- name, \
- id##_pins, \
- ARRAY_SIZE(id##_pins), \
- funcs, \
- }
+ PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), funcs)
#define INGENIC_PIN_GROUP(name, id, func) \
- INGENIC_PIN_GROUP_FUNCS(name, id, (void *)(func))
+ PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
enum jz_version {
ID_JZ4730,
--
2.43.0.rc1.1.gbec44491f096
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]>
---
drivers/pinctrl/nuvoton/pinctrl-wpcm450.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c b/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c
index 0cff44b07b29..4589900244c7 100644
--- a/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c
+++ b/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c
@@ -474,9 +474,8 @@ enum {
#undef WPCM450_GRP
};
-static struct group_desc wpcm450_groups[] = {
-#define WPCM450_GRP(x) { .name = #x, .pins = x ## _pins, \
- .num_pins = ARRAY_SIZE(x ## _pins) }
+static struct pingroup wpcm450_groups[] = {
+#define WPCM450_GRP(x) PINCTRL_PINGROUP(#x, x ## _pins, ARRAY_SIZE(x ## _pins))
WPCM450_GRPS
#undef WPCM450_GRP
};
@@ -852,7 +851,7 @@ static int wpcm450_get_group_pins(struct pinctrl_dev *pctldev,
const unsigned int **pins,
unsigned int *npins)
{
- *npins = wpcm450_groups[selector].num_pins;
+ *npins = wpcm450_groups[selector].npins;
*pins = wpcm450_groups[selector].pins;
return 0;
@@ -901,7 +900,7 @@ static int wpcm450_pinmux_set_mux(struct pinctrl_dev *pctldev,
struct wpcm450_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev);
wpcm450_setfunc(pctrl->gcr_regmap, wpcm450_groups[group].pins,
- wpcm450_groups[group].num_pins, function);
+ wpcm450_groups[group].npins, function);
return 0;
}
--
2.43.0.rc1.1.gbec44491f096
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.
Signed-off-by: Andy Shevchenko <[email protected]>
---
drivers/pinctrl/core.c | 15 ++++++++++++---
drivers/pinctrl/core.h | 5 +++++
2 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c
index 3f1fd50fbb10..e08d4b3b0a56 100644
--- a/drivers/pinctrl/core.c
+++ b/drivers/pinctrl/core.c
@@ -559,7 +559,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);
@@ -585,8 +588,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;
}
diff --git a/drivers/pinctrl/core.h b/drivers/pinctrl/core.h
index 276a631fd49c..863b4956a41e 100644
--- a/drivers/pinctrl/core.h
+++ b/drivers/pinctrl/core.h
@@ -194,14 +194,18 @@ struct pinctrl_maps {
#ifdef CONFIG_GENERIC_PINCTRL_GROUPS
+#include <linux/pinctrl/pinctrl.h>
+
/**
* struct group_desc - generic pin group descriptor
+ * @grp: generic data of the pin group (name and pins)
* @name: name of the pin group
* @pins: array of pins that belong to the group
* @num_pins: number of pins in the group
* @data: pin controller driver specific data
*/
struct group_desc {
+ struct pingroup grp;
const char *name;
const int *pins;
int num_pins;
@@ -211,6 +215,7 @@ struct group_desc {
/* Convenience macro to define a generic pin group descriptor */
#define PINCTRL_GROUP_DESC(_name, _pins, _num_pins, _data) \
(struct group_desc) { \
+ .grp = PINCTRL_PINGROUP(_name, _pins, _num_pins), \
.name = _name, \
.pins = _pins, \
.num_pins = _num_pins, \
--
2.43.0.rc1.1.gbec44491f096
The pin control header provides struct pingroup.
Utilize it instead of open coded variants in the driver.
Signed-off-by: Andy Shevchenko <[email protected]>
---
drivers/pinctrl/pinctrl-keembay.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/pinctrl/pinctrl-keembay.c b/drivers/pinctrl/pinctrl-keembay.c
index 152c35bce8ec..87d328853ae4 100644
--- a/drivers/pinctrl/pinctrl-keembay.c
+++ b/drivers/pinctrl/pinctrl-keembay.c
@@ -1517,7 +1517,7 @@ static int keembay_gpiochip_probe(struct keembay_pinctrl *kpc,
static int keembay_build_groups(struct keembay_pinctrl *kpc)
{
- struct group_desc *grp;
+ struct pingroup *grp;
unsigned int i;
kpc->ngroups = kpc->npins;
@@ -1528,7 +1528,7 @@ static int keembay_build_groups(struct keembay_pinctrl *kpc)
/* Each pin is categorised as one group */
for (i = 0; i < kpc->ngroups; i++) {
const struct pinctrl_pin_desc *pdesc = keembay_pins + i;
- struct group_desc *kmb_grp = grp + i;
+ struct pingroup *kmb_grp = grp + i;
kmb_grp->name = pdesc->name;
kmb_grp->pins = (int *)&pdesc->number;
--
2.43.0.rc1.1.gbec44491f096
It's unclear why it's not a const from day 1. Make the pins member
const in struct group_desc. Update necessary APIs.
Signed-off-by: Andy Shevchenko <[email protected]>
---
drivers/pinctrl/core.c | 2 +-
drivers/pinctrl/core.h | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c
index f2977eb65522..d20e3aad923e 100644
--- a/drivers/pinctrl/core.c
+++ b/drivers/pinctrl/core.c
@@ -642,7 +642,7 @@ static int pinctrl_generic_group_name_to_selector(struct pinctrl_dev *pctldev,
* Note that the caller must take care of locking.
*/
int pinctrl_generic_add_group(struct pinctrl_dev *pctldev, const char *name,
- int *pins, int num_pins, void *data)
+ const int *pins, int num_pins, void *data)
{
struct group_desc *group;
int selector, error;
diff --git a/drivers/pinctrl/core.h b/drivers/pinctrl/core.h
index 530370443c19..01ea1ce99fe8 100644
--- a/drivers/pinctrl/core.h
+++ b/drivers/pinctrl/core.h
@@ -203,7 +203,7 @@ struct pinctrl_maps {
*/
struct group_desc {
const char *name;
- int *pins;
+ const int *pins;
int num_pins;
void *data;
};
@@ -222,7 +222,7 @@ struct group_desc *pinctrl_generic_get_group(struct pinctrl_dev *pctldev,
unsigned int group_selector);
int pinctrl_generic_add_group(struct pinctrl_dev *pctldev, const char *name,
- int *gpins, int ngpins, void *data);
+ const int *pins, int num_pins, void *data);
int pinctrl_generic_remove_group(struct pinctrl_dev *pctldev,
unsigned int group_selector);
--
2.43.0.rc1.1.gbec44491f096
Make use of PINCTRL_GROUP_DESC() instead of open coding it.
Signed-off-by: Andy Shevchenko <[email protected]>
---
drivers/pinctrl/mediatek/pinctrl-moore.h | 7 +------
drivers/pinctrl/mediatek/pinctrl-paris.h | 7 +------
2 files changed, 2 insertions(+), 12 deletions(-)
diff --git a/drivers/pinctrl/mediatek/pinctrl-moore.h b/drivers/pinctrl/mediatek/pinctrl-moore.h
index e1b4b82b9d3d..22ef1ffbcdcb 100644
--- a/drivers/pinctrl/mediatek/pinctrl-moore.h
+++ b/drivers/pinctrl/mediatek/pinctrl-moore.h
@@ -38,12 +38,7 @@
}
#define PINCTRL_PIN_GROUP(name, id) \
- { \
- name, \
- id##_pins, \
- ARRAY_SIZE(id##_pins), \
- id##_funcs, \
- }
+ PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), id##_funcs)
int mtk_moore_pinctrl_probe(struct platform_device *pdev,
const struct mtk_pin_soc *soc);
diff --git a/drivers/pinctrl/mediatek/pinctrl-paris.h b/drivers/pinctrl/mediatek/pinctrl-paris.h
index 8762ac599329..f208a904c4a8 100644
--- a/drivers/pinctrl/mediatek/pinctrl-paris.h
+++ b/drivers/pinctrl/mediatek/pinctrl-paris.h
@@ -50,12 +50,7 @@
}
#define PINCTRL_PIN_GROUP(name, id) \
- { \
- name, \
- id##_pins, \
- ARRAY_SIZE(id##_pins), \
- id##_funcs, \
- }
+ PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), id##_funcs)
int mtk_paris_pinctrl_probe(struct platform_device *pdev);
--
2.43.0.rc1.1.gbec44491f096
The pin control header provides struct pingroup.
Utilize it instead of open coded variants in the driver.
Signed-off-by: Andy Shevchenko <[email protected]>
---
drivers/pinctrl/pinctrl-equilibrium.c | 28 +++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/drivers/pinctrl/pinctrl-equilibrium.c b/drivers/pinctrl/pinctrl-equilibrium.c
index 91157a2b949c..2165fe6833c9 100644
--- a/drivers/pinctrl/pinctrl-equilibrium.c
+++ b/drivers/pinctrl/pinctrl-equilibrium.c
@@ -705,7 +705,7 @@ static int eqbr_build_groups(struct eqbr_pinctrl_drv_data *drvdata)
struct device *dev = drvdata->dev;
struct device_node *node = dev->of_node;
unsigned int *pins, *pinmux, pin_id, pinmux_id;
- struct group_desc group;
+ struct pingroup group, *grp = &group;
struct device_node *np;
struct property *prop;
int j, err;
@@ -715,54 +715,54 @@ static int eqbr_build_groups(struct eqbr_pinctrl_drv_data *drvdata)
if (!prop)
continue;
- group.num_pins = of_property_count_u32_elems(np, "pins");
- if (group.num_pins < 0) {
+ grp->npins = of_property_count_u32_elems(np, "pins");
+ if (grp->npins < 0) {
dev_err(dev, "No pins in the group: %s\n", prop->name);
of_node_put(np);
return -EINVAL;
}
- group.name = prop->value;
- pins = devm_kcalloc(dev, group.num_pins, sizeof(*pins), GFP_KERNEL);
+ grp->name = prop->value;
+ pins = devm_kcalloc(dev, grp->npins, sizeof(*pins), GFP_KERNEL);
if (!pins) {
of_node_put(np);
return -ENOMEM;
}
- group.pins = pins;
+ grp->pins = pins;
- pinmux = devm_kcalloc(dev, group.num_pins, sizeof(*pinmux), GFP_KERNEL);
+ pinmux = devm_kcalloc(dev, grp->npins, sizeof(*pinmux), GFP_KERNEL);
if (!pinmux) {
of_node_put(np);
return -ENOMEM;
}
- for (j = 0; j < group.num_pins; j++) {
+ for (j = 0; j < grp->npins; j++) {
if (of_property_read_u32_index(np, "pins", j, &pin_id)) {
dev_err(dev, "Group %s: Read intel pins id failed\n",
- group.name);
+ grp->name);
of_node_put(np);
return -EINVAL;
}
if (pin_id >= drvdata->pctl_desc.npins) {
dev_err(dev, "Group %s: Invalid pin ID, idx: %d, pin %u\n",
- group.name, j, pin_id);
+ grp->name, j, pin_id);
of_node_put(np);
return -EINVAL;
}
pins[j] = pin_id;
if (of_property_read_u32_index(np, "pinmux", j, &pinmux_id)) {
dev_err(dev, "Group %s: Read intel pinmux id failed\n",
- group.name);
+ grp->name);
of_node_put(np);
return -EINVAL;
}
pinmux[j] = pinmux_id;
}
- err = pinctrl_generic_add_group(drvdata->pctl_dev, group.name,
- group.pins, group.num_pins,
+ err = pinctrl_generic_add_group(drvdata->pctl_dev,
+ grp->name, grp->pins, grp->npins,
pinmux);
if (err < 0) {
- dev_err(dev, "Failed to register group %s\n", group.name);
+ dev_err(dev, "Failed to register group %s\n", grp->name);
of_node_put(np);
return err;
}
--
2.43.0.rc1.1.gbec44491f096
Convert drivers to use grp member embedded in struct group_desc.
Signed-off-by: Andy Shevchenko <[email protected]>
---
drivers/pinctrl/pinctrl-equilibrium.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/pinctrl/pinctrl-equilibrium.c b/drivers/pinctrl/pinctrl-equilibrium.c
index 2165fe6833c9..eb9921569e45 100644
--- a/drivers/pinctrl/pinctrl-equilibrium.c
+++ b/drivers/pinctrl/pinctrl-equilibrium.c
@@ -331,8 +331,8 @@ static int eqbr_pinmux_set_mux(struct pinctrl_dev *pctldev,
return -EINVAL;
pinmux = grp->data;
- for (i = 0; i < grp->num_pins; i++)
- eqbr_set_pin_mux(pctl, pinmux[i], grp->pins[i]);
+ for (i = 0; i < grp->grp.npins; i++)
+ eqbr_set_pin_mux(pctl, pinmux[i], grp->grp.pins[i]);
return 0;
}
--
2.43.0.rc1.1.gbec44491f096
Convert drivers to use grp member embedded in struct group_desc.
Signed-off-by: Andy Shevchenko <[email protected]>
---
drivers/pinctrl/bcm/pinctrl-ns.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/pinctrl/bcm/pinctrl-ns.c b/drivers/pinctrl/bcm/pinctrl-ns.c
index d099a7f25f64..6bb2b461950b 100644
--- a/drivers/pinctrl/bcm/pinctrl-ns.c
+++ b/drivers/pinctrl/bcm/pinctrl-ns.c
@@ -171,8 +171,8 @@ static int ns_pinctrl_set_mux(struct pinctrl_dev *pctrl_dev,
if (!group)
return -EINVAL;
- for (i = 0; i < group->num_pins; i++)
- unset |= BIT(group->pins[i]);
+ for (i = 0; i < group->grp.npins; i++)
+ unset |= BIT(group->grp.pins[i]);
tmp = readl(ns_pinctrl->base);
tmp &= ~unset;
--
2.43.0.rc1.1.gbec44491f096
Add PINCTRL_GROUP_DESC() macro for inline use.
Signed-off-by: Andy Shevchenko <[email protected]>
---
drivers/pinctrl/core.c | 5 +----
drivers/pinctrl/core.h | 9 +++++++++
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c
index d20e3aad923e..3f1fd50fbb10 100644
--- a/drivers/pinctrl/core.c
+++ b/drivers/pinctrl/core.c
@@ -660,10 +660,7 @@ int pinctrl_generic_add_group(struct pinctrl_dev *pctldev, const char *name,
if (!group)
return -ENOMEM;
- group->name = name;
- group->pins = pins;
- group->num_pins = num_pins;
- group->data = data;
+ *group = PINCTRL_GROUP_DESC(name, pins, num_pins, data);
error = radix_tree_insert(&pctldev->pin_group_tree, selector, group);
if (error)
diff --git a/drivers/pinctrl/core.h b/drivers/pinctrl/core.h
index 01ea1ce99fe8..276a631fd49c 100644
--- a/drivers/pinctrl/core.h
+++ b/drivers/pinctrl/core.h
@@ -208,6 +208,15 @@ struct group_desc {
void *data;
};
+/* Convenience macro to define a generic pin group descriptor */
+#define PINCTRL_GROUP_DESC(_name, _pins, _num_pins, _data) \
+(struct group_desc) { \
+ .name = _name, \
+ .pins = _pins, \
+ .num_pins = _num_pins, \
+ .data = _data, \
+}
+
int pinctrl_generic_get_group_count(struct pinctrl_dev *pctldev);
const char *pinctrl_generic_get_group_name(struct pinctrl_dev *pctldev,
--
2.43.0.rc1.1.gbec44491f096
Convert drivers to use grp member embedded in struct group_desc.
Signed-off-by: Andy Shevchenko <[email protected]>
---
drivers/pinctrl/pinctrl-keembay.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pinctrl/pinctrl-keembay.c b/drivers/pinctrl/pinctrl-keembay.c
index 87d328853ae4..b1349ee22799 100644
--- a/drivers/pinctrl/pinctrl-keembay.c
+++ b/drivers/pinctrl/pinctrl-keembay.c
@@ -945,7 +945,7 @@ static int keembay_set_mux(struct pinctrl_dev *pctldev, unsigned int fun_sel,
return -EINVAL;
/* Change modes for pins in the selected group */
- pin = *grp->pins;
+ pin = *grp->grp.pins;
pin_mode = *(u8 *)(func->data);
val = keembay_read_reg(kpc->base1 + KEEMBAY_GPIO_MODE, pin);
--
2.43.0.rc1.1.gbec44491f096
Convert drivers to use grp member embedded in struct group_desc.
Signed-off-by: Andy Shevchenko <[email protected]>
---
drivers/pinctrl/mediatek/pinctrl-moore.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/drivers/pinctrl/mediatek/pinctrl-moore.c b/drivers/pinctrl/mediatek/pinctrl-moore.c
index c3d59eddd994..d972584c0519 100644
--- a/drivers/pinctrl/mediatek/pinctrl-moore.c
+++ b/drivers/pinctrl/mediatek/pinctrl-moore.c
@@ -56,12 +56,12 @@ static int mtk_pinmux_set_mux(struct pinctrl_dev *pctldev,
return -EINVAL;
dev_dbg(pctldev->dev, "enable function %s group %s\n",
- func->name, grp->name);
+ func->name, grp->grp.name);
- for (i = 0; i < grp->num_pins; i++) {
+ for (i = 0; i < grp->grp.npins; i++) {
const struct mtk_pin_desc *desc;
int *pin_modes = grp->data;
- int pin = grp->pins[i];
+ int pin = grp->grp.pins[i];
desc = (const struct mtk_pin_desc *)&hw->soc->pins[pin];
if (!desc->name)
@@ -602,13 +602,12 @@ static int mtk_build_groups(struct mtk_pinctrl *hw)
for (i = 0; i < hw->soc->ngrps; i++) {
const struct group_desc *group = hw->soc->grps + i;
+ const struct pingroup *grp = &group->grp;
- err = pinctrl_generic_add_group(hw->pctrl, group->name,
- group->pins, group->num_pins,
+ err = pinctrl_generic_add_group(hw->pctrl, grp->name, grp->pins, grp->npins,
group->data);
if (err < 0) {
- dev_err(hw->dev, "Failed to register group %s\n",
- group->name);
+ dev_err(hw->dev, "Failed to register group %s\n", grp->name);
return err;
}
}
--
2.43.0.rc1.1.gbec44491f096
Convert drivers to use grp member embedded in struct group_desc.
Signed-off-by: Andy Shevchenko <[email protected]>
---
drivers/pinctrl/freescale/pinctrl-imx.c | 31 +++++++++++--------------
1 file changed, 14 insertions(+), 17 deletions(-)
diff --git a/drivers/pinctrl/freescale/pinctrl-imx.c b/drivers/pinctrl/freescale/pinctrl-imx.c
index 9099a7c81d4a..4245189b59a5 100644
--- a/drivers/pinctrl/freescale/pinctrl-imx.c
+++ b/drivers/pinctrl/freescale/pinctrl-imx.c
@@ -42,7 +42,7 @@ static inline const struct group_desc *imx_pinctrl_find_group_by_name(
for (i = 0; i < pctldev->num_groups; i++) {
grp = pinctrl_generic_get_group(pctldev, i);
- if (grp && !strcmp(grp->name, name))
+ if (grp && !strcmp(grp->grp.name, name))
break;
}
@@ -79,9 +79,9 @@ static int imx_dt_node_to_map(struct pinctrl_dev *pctldev,
}
if (info->flags & IMX_USE_SCU) {
- map_num += grp->num_pins;
+ map_num += grp->grp.npins;
} else {
- for (i = 0; i < grp->num_pins; i++) {
+ for (i = 0; i < grp->grp.npins; i++) {
pin = &((struct imx_pin *)(grp->data))[i];
if (!(pin->conf.mmio.config & IMX_NO_PAD_CTL))
map_num++;
@@ -109,7 +109,7 @@ static int imx_dt_node_to_map(struct pinctrl_dev *pctldev,
/* create config map */
new_map++;
- for (i = j = 0; i < grp->num_pins; i++) {
+ for (i = j = 0; i < grp->grp.npins; i++) {
pin = &((struct imx_pin *)(grp->data))[i];
/*
@@ -263,10 +263,10 @@ static int imx_pmx_set(struct pinctrl_dev *pctldev, unsigned selector,
if (!func)
return -EINVAL;
- npins = grp->num_pins;
+ npins = grp->grp.npins;
dev_dbg(ipctl->dev, "enable function %s group %s\n",
- func->name, grp->name);
+ func->name, grp->grp.name);
for (i = 0; i < npins; i++) {
/*
@@ -423,7 +423,7 @@ static void imx_pinconf_group_dbg_show(struct pinctrl_dev *pctldev,
if (!grp)
return;
- for (i = 0; i < grp->num_pins; i++) {
+ for (i = 0; i < grp->grp.npins; i++) {
struct imx_pin *pin = &((struct imx_pin *)(grp->data))[i];
name = pin_get_name(pctldev, pin->pin);
@@ -526,7 +526,7 @@ static int imx_pinctrl_parse_groups(struct device_node *np,
pin_size = FSL_PIN_SIZE;
/* Initialise group */
- grp->name = np->name;
+ grp->grp.name = np->name;
/*
* the binding format is fsl,pins = <PIN_FUNC_ID CONFIG ...>,
@@ -554,19 +554,17 @@ static int imx_pinctrl_parse_groups(struct device_node *np,
return -EINVAL;
}
- grp->num_pins = size / pin_size;
- grp->data = devm_kcalloc(ipctl->dev,
- grp->num_pins, sizeof(struct imx_pin),
- GFP_KERNEL);
+ grp->grp.npins = size / pin_size;
+ grp->data = devm_kcalloc(ipctl->dev, grp->grp.npins, sizeof(*pin), GFP_KERNEL);
if (!grp->data)
return -ENOMEM;
- pins = devm_kcalloc(ipctl->dev, grp->num_pins, sizeof(*pins), GFP_KERNEL);
+ pins = devm_kcalloc(ipctl->dev, grp->grp.npins, sizeof(*pins), GFP_KERNEL);
if (!pins)
return -ENOMEM;
- grp->pins = pins;
+ grp->grp.pins = pins;
- for (i = 0; i < grp->num_pins; i++) {
+ for (i = 0; i < grp->grp.npins; i++) {
pin = &((struct imx_pin *)(grp->data))[i];
if (info->flags & IMX_USE_SCU)
info->imx_pinctrl_parse_pin(ipctl, &pins[i], pin, &list);
@@ -613,8 +611,7 @@ static int imx_pinctrl_parse_functions(struct device_node *np,
i = 0;
for_each_child_of_node(np, child) {
- grp = devm_kzalloc(ipctl->dev, sizeof(struct group_desc),
- GFP_KERNEL);
+ grp = devm_kzalloc(ipctl->dev, sizeof(*grp), GFP_KERNEL);
if (!grp) {
of_node_put(child);
return -ENOMEM;
--
2.43.0.rc1.1.gbec44491f096
All drivers are converted to use embedded struct pingroup.
Remove unused members from struct group_desc.
Signed-off-by: Andy Shevchenko <[email protected]>
---
drivers/pinctrl/core.c | 9 ---------
drivers/pinctrl/core.h | 9 ---------
2 files changed, 18 deletions(-)
diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c
index e08d4b3b0a56..88de80187445 100644
--- a/drivers/pinctrl/core.c
+++ b/drivers/pinctrl/core.c
@@ -559,9 +559,6 @@ const char *pinctrl_generic_get_group_name(struct pinctrl_dev *pctldev,
if (!group)
return NULL;
- if (group->name)
- return group->name;
-
return group->grp.name;
}
EXPORT_SYMBOL_GPL(pinctrl_generic_get_group_name);
@@ -588,12 +585,6 @@ int pinctrl_generic_get_group_pins(struct pinctrl_dev *pctldev,
return -EINVAL;
}
- if (group->pins) {
- *pins = group->pins;
- *num_pins = group->num_pins;
- return 0;
- }
-
*pins = group->grp.pins;
*num_pins = group->grp.npins;
diff --git a/drivers/pinctrl/core.h b/drivers/pinctrl/core.h
index 863b4956a41e..c1ace4c2eccc 100644
--- a/drivers/pinctrl/core.h
+++ b/drivers/pinctrl/core.h
@@ -199,16 +199,10 @@ struct pinctrl_maps {
/**
* struct group_desc - generic pin group descriptor
* @grp: generic data of the pin group (name and pins)
- * @name: name of the pin group
- * @pins: array of pins that belong to the group
- * @num_pins: number of pins in the group
* @data: pin controller driver specific data
*/
struct group_desc {
struct pingroup grp;
- const char *name;
- const int *pins;
- int num_pins;
void *data;
};
@@ -216,9 +210,6 @@ struct group_desc {
#define PINCTRL_GROUP_DESC(_name, _pins, _num_pins, _data) \
(struct group_desc) { \
.grp = PINCTRL_PINGROUP(_name, _pins, _num_pins), \
- .name = _name, \
- .pins = _pins, \
- .num_pins = _num_pins, \
.data = _data, \
}
--
2.43.0.rc1.1.gbec44491f096
Convert drivers to use grp member embedded in struct group_desc.
Signed-off-by: Andy Shevchenko <[email protected]>
---
drivers/pinctrl/renesas/pinctrl-rza1.c | 2 +-
drivers/pinctrl/renesas/pinctrl-rza2.c | 10 +++++-----
drivers/pinctrl/renesas/pinctrl-rzg2l.c | 6 +++---
drivers/pinctrl/renesas/pinctrl-rzv2m.c | 6 +++---
4 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/drivers/pinctrl/renesas/pinctrl-rza1.c b/drivers/pinctrl/renesas/pinctrl-rza1.c
index ab334de89b69..b03f22c54ca8 100644
--- a/drivers/pinctrl/renesas/pinctrl-rza1.c
+++ b/drivers/pinctrl/renesas/pinctrl-rza1.c
@@ -1131,7 +1131,7 @@ static int rza1_set_mux(struct pinctrl_dev *pctldev, unsigned int selector,
return -EINVAL;
mux_confs = (struct rza1_mux_conf *)func->data;
- for (i = 0; i < grp->num_pins; ++i) {
+ for (i = 0; i < grp->grp.npins; ++i) {
int ret;
ret = rza1_pin_mux_single(rza1_pctl, &mux_confs[i]);
diff --git a/drivers/pinctrl/renesas/pinctrl-rza2.c b/drivers/pinctrl/renesas/pinctrl-rza2.c
index 990b96d45967..af689d7c117f 100644
--- a/drivers/pinctrl/renesas/pinctrl-rza2.c
+++ b/drivers/pinctrl/renesas/pinctrl-rza2.c
@@ -447,15 +447,15 @@ static int rza2_set_mux(struct pinctrl_dev *pctldev, unsigned int selector,
psel_val = func->data;
- for (i = 0; i < grp->num_pins; ++i) {
+ for (i = 0; i < grp->grp.npins; ++i) {
dev_dbg(priv->dev, "Setting P%c_%d to PSEL=%d\n",
- port_names[RZA2_PIN_ID_TO_PORT(grp->pins[i])],
- RZA2_PIN_ID_TO_PIN(grp->pins[i]),
+ port_names[RZA2_PIN_ID_TO_PORT(grp->grp.pins[i])],
+ RZA2_PIN_ID_TO_PIN(grp->grp.pins[i]),
psel_val[i]);
rza2_set_pin_function(
priv->base,
- RZA2_PIN_ID_TO_PORT(grp->pins[i]),
- RZA2_PIN_ID_TO_PIN(grp->pins[i]),
+ RZA2_PIN_ID_TO_PORT(grp->grp.pins[i]),
+ RZA2_PIN_ID_TO_PIN(grp->grp.pins[i]),
psel_val[i]);
}
diff --git a/drivers/pinctrl/renesas/pinctrl-rzg2l.c b/drivers/pinctrl/renesas/pinctrl-rzg2l.c
index 9de350ad7e7d..504e8716fc32 100644
--- a/drivers/pinctrl/renesas/pinctrl-rzg2l.c
+++ b/drivers/pinctrl/renesas/pinctrl-rzg2l.c
@@ -273,7 +273,7 @@ static int rzg2l_pinctrl_set_mux(struct pinctrl_dev *pctldev,
struct function_desc *func;
unsigned int i, *psel_val;
struct group_desc *group;
- int *pins;
+ const int *pins;
func = pinmux_generic_get_function(pctldev, func_selector);
if (!func)
@@ -283,9 +283,9 @@ static int rzg2l_pinctrl_set_mux(struct pinctrl_dev *pctldev,
return -EINVAL;
psel_val = func->data;
- pins = group->pins;
+ pins = group->grp.pins;
- for (i = 0; i < group->num_pins; i++) {
+ for (i = 0; i < group->grp.npins; i++) {
unsigned int *pin_data = pctrl->desc.pins[pins[i]].drv_data;
u32 off = RZG2L_PIN_CFG_TO_PORT_OFFSET(*pin_data);
u32 pin = RZG2L_PIN_ID_TO_PIN(pins[i]);
diff --git a/drivers/pinctrl/renesas/pinctrl-rzv2m.c b/drivers/pinctrl/renesas/pinctrl-rzv2m.c
index 21d7d5ac8c4a..eb66e306b8c8 100644
--- a/drivers/pinctrl/renesas/pinctrl-rzv2m.c
+++ b/drivers/pinctrl/renesas/pinctrl-rzv2m.c
@@ -165,7 +165,7 @@ static int rzv2m_pinctrl_set_mux(struct pinctrl_dev *pctldev,
struct function_desc *func;
unsigned int i, *psel_val;
struct group_desc *group;
- int *pins;
+ const int *pins;
func = pinmux_generic_get_function(pctldev, func_selector);
if (!func)
@@ -175,9 +175,9 @@ static int rzv2m_pinctrl_set_mux(struct pinctrl_dev *pctldev,
return -EINVAL;
psel_val = func->data;
- pins = group->pins;
+ pins = group->grp.pins;
- for (i = 0; i < group->num_pins; i++) {
+ for (i = 0; i < group->grp.npins; i++) {
dev_dbg(pctrl->dev, "port:%u pin: %u PSEL:%u\n",
RZV2M_PIN_ID_TO_PORT(pins[i]), RZV2M_PIN_ID_TO_PIN(pins[i]),
psel_val[i]);
--
2.43.0.rc1.1.gbec44491f096
Convert drivers to use grp member embedded in struct group_desc.
Signed-off-by: Andy Shevchenko <[email protected]>
---
drivers/pinctrl/starfive/pinctrl-starfive-jh7100.c | 8 ++++----
drivers/pinctrl/starfive/pinctrl-starfive-jh7110.c | 8 ++++----
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/pinctrl/starfive/pinctrl-starfive-jh7100.c b/drivers/pinctrl/starfive/pinctrl-starfive-jh7100.c
index ea70b8c61679..21bfbbaede72 100644
--- a/drivers/pinctrl/starfive/pinctrl-starfive-jh7100.c
+++ b/drivers/pinctrl/starfive/pinctrl-starfive-jh7100.c
@@ -654,7 +654,7 @@ static int starfive_set_mux(struct pinctrl_dev *pctldev,
return -EINVAL;
pinmux = group->data;
- for (i = 0; i < group->num_pins; i++) {
+ for (i = 0; i < group->grp.npins; i++) {
u32 v = pinmux[i];
unsigned int gpio = starfive_pinmux_to_gpio(v);
u32 dout = starfive_pinmux_to_dout(v);
@@ -797,7 +797,7 @@ static int starfive_pinconf_group_get(struct pinctrl_dev *pctldev,
if (!group)
return -EINVAL;
- return starfive_pinconf_get(pctldev, group->pins[0], config);
+ return starfive_pinconf_get(pctldev, group->grp.pins[0], config);
}
static int starfive_pinconf_group_set(struct pinctrl_dev *pctldev,
@@ -876,8 +876,8 @@ static int starfive_pinconf_group_set(struct pinctrl_dev *pctldev,
}
}
- for (i = 0; i < group->num_pins; i++)
- starfive_padctl_rmw(sfp, group->pins[i], mask, value);
+ for (i = 0; i < group->grp.npins; i++)
+ starfive_padctl_rmw(sfp, group->grp.pins[i], mask, value);
return 0;
}
diff --git a/drivers/pinctrl/starfive/pinctrl-starfive-jh7110.c b/drivers/pinctrl/starfive/pinctrl-starfive-jh7110.c
index 9d71e8c13310..60160965cd29 100644
--- a/drivers/pinctrl/starfive/pinctrl-starfive-jh7110.c
+++ b/drivers/pinctrl/starfive/pinctrl-starfive-jh7110.c
@@ -307,7 +307,7 @@ static int jh7110_set_mux(struct pinctrl_dev *pctldev,
return -EINVAL;
pinmux = group->data;
- for (i = 0; i < group->num_pins; i++) {
+ for (i = 0; i < group->grp.npins; i++) {
u32 v = pinmux[i];
if (info->jh7110_set_one_pin_mux)
@@ -437,7 +437,7 @@ static int jh7110_pinconf_group_get(struct pinctrl_dev *pctldev,
if (!group)
return -EINVAL;
- return jh7110_pinconf_get(pctldev, group->pins[0], config);
+ return jh7110_pinconf_get(pctldev, group->grp.pins[0], config);
}
static int jh7110_pinconf_group_set(struct pinctrl_dev *pctldev,
@@ -508,8 +508,8 @@ static int jh7110_pinconf_group_set(struct pinctrl_dev *pctldev,
}
}
- for (i = 0; i < group->num_pins; i++)
- jh7110_padcfg_rmw(sfp, group->pins[i], mask, value);
+ for (i = 0; i < group->grp.npins; i++)
+ jh7110_padcfg_rmw(sfp, group->grp.pins[i], mask, value);
return 0;
}
--
2.43.0.rc1.1.gbec44491f096
Convert drivers to use grp member embedded in struct group_desc.
Signed-off-by: Andy Shevchenko <[email protected]>
---
drivers/pinctrl/pinctrl-ingenic.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/pinctrl/pinctrl-ingenic.c b/drivers/pinctrl/pinctrl-ingenic.c
index 393873de910a..6806fede5df4 100644
--- a/drivers/pinctrl/pinctrl-ingenic.c
+++ b/drivers/pinctrl/pinctrl-ingenic.c
@@ -3756,17 +3756,17 @@ static int ingenic_pinmux_set_mux(struct pinctrl_dev *pctldev,
return -EINVAL;
dev_dbg(pctldev->dev, "enable function %s group %s\n",
- func->name, grp->name);
+ func->name, grp->grp.name);
mode = (uintptr_t)grp->data;
if (mode <= 3) {
- for (i = 0; i < grp->num_pins; i++)
- ingenic_pinmux_set_pin_fn(jzpc, grp->pins[i], mode);
+ for (i = 0; i < grp->grp.npins; i++)
+ ingenic_pinmux_set_pin_fn(jzpc, grp->grp.pins[i], mode);
} else {
pin_modes = grp->data;
- for (i = 0; i < grp->num_pins; i++)
- ingenic_pinmux_set_pin_fn(jzpc, grp->pins[i], pin_modes[i]);
+ for (i = 0; i < grp->grp.npins; i++)
+ ingenic_pinmux_set_pin_fn(jzpc, grp->grp.pins[i], pin_modes[i]);
}
return 0;
@@ -4293,12 +4293,12 @@ static int __init ingenic_pinctrl_probe(struct platform_device *pdev)
for (i = 0; i < chip_info->num_groups; i++) {
const struct group_desc *group = &chip_info->groups[i];
+ const struct pingroup *grp = &group->grp;
- err = pinctrl_generic_add_group(jzpc->pctl, group->name,
- group->pins, group->num_pins, group->data);
+ err = pinctrl_generic_add_group(jzpc->pctl, grp->name, grp->pins, grp->npins,
+ group->data);
if (err < 0) {
- dev_err(dev, "Failed to register group %s\n",
- group->name);
+ dev_err(dev, "Failed to register group %s\n", grp->name);
return err;
}
}
--
2.43.0.rc1.1.gbec44491f096
On Thu, Nov 23, 2023 at 8:34 PM Andy Shevchenko
<[email protected]> wrote:
> The struct group_desc has a lot of duplication with struct pingroup.
> Deduplicate that by embeddind the latter in the former and convert
> users.
>
> Linus, assuming everything is fine, I can push this to my tree.
> Or you can apply it (assumming all CIs and people are happy with
> the series).
I would give people some time to test the changes and ACK it,
but admittedly it's a very tasty patch set and I am eager to merge
it ASAP.
Shall we give people a week and then we merge it?
> NB. This series contains previously sent patches for Qualcomm and
> Nuovoton. Here the updated version for Qualcomm that splits previous
> patch to two and fixes compilation warnings.
Fair enough, I'll just use this series.
> NB. The function_desc is in plan to follow the similar deduplication.
Yes!
Yours,
Linus Walleij
Hi Andy,
Le jeudi 23 novembre 2023 à 21:31 +0200, Andy Shevchenko a écrit :
> Convert drivers to use grp member embedded in struct group_desc.
>
> Signed-off-by: Andy Shevchenko <[email protected]>
Acked-by: Paul Cercueil <[email protected]>
Cheers,
-Paul
> ---
> Â drivers/pinctrl/pinctrl-ingenic.c | 18 +++++++++---------
> Â 1 file changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/pinctrl/pinctrl-ingenic.c
> b/drivers/pinctrl/pinctrl-ingenic.c
> index 393873de910a..6806fede5df4 100644
> --- a/drivers/pinctrl/pinctrl-ingenic.c
> +++ b/drivers/pinctrl/pinctrl-ingenic.c
> @@ -3756,17 +3756,17 @@ static int ingenic_pinmux_set_mux(struct
> pinctrl_dev *pctldev,
> Â return -EINVAL;
> Â
> Â dev_dbg(pctldev->dev, "enable function %s group %s\n",
> - func->name, grp->name);
> + func->name, grp->grp.name);
> Â
> Â mode = (uintptr_t)grp->data;
> Â if (mode <= 3) {
> - for (i = 0; i < grp->num_pins; i++)
> - ingenic_pinmux_set_pin_fn(jzpc, grp-
> >pins[i], mode);
> + for (i = 0; i < grp->grp.npins; i++)
> + ingenic_pinmux_set_pin_fn(jzpc, grp-
> >grp.pins[i], mode);
> Â } else {
> Â pin_modes = grp->data;
> Â
> - for (i = 0; i < grp->num_pins; i++)
> - ingenic_pinmux_set_pin_fn(jzpc, grp-
> >pins[i], pin_modes[i]);
> + for (i = 0; i < grp->grp.npins; i++)
> + ingenic_pinmux_set_pin_fn(jzpc, grp-
> >grp.pins[i], pin_modes[i]);
> Â }
> Â
> Â return 0;
> @@ -4293,12 +4293,12 @@ static int __init
> ingenic_pinctrl_probe(struct platform_device *pdev)
> Â
> Â for (i = 0; i < chip_info->num_groups; i++) {
> Â const struct group_desc *group = &chip_info-
> >groups[i];
> + const struct pingroup *grp = &group->grp;
> Â
> - err = pinctrl_generic_add_group(jzpc->pctl, group-
> >name,
> - group->pins, group->num_pins, group-
> >data);
> + err = pinctrl_generic_add_group(jzpc->pctl, grp-
> >name, grp->pins, grp->npins,
> + group->data);
> Â if (err < 0) {
> - dev_err(dev, "Failed to register group
> %s\n",
> - group->name);
> + dev_err(dev, "Failed to register group
> %s\n", grp->name);
> Â return err;
> Â }
> Â }
Hi Andy,
kernel test robot noticed the following build warnings:
[auto build test WARNING on linusw-pinctrl/devel]
[also build test WARNING on linusw-pinctrl/for-next next-20231124]
[cannot apply to geert-renesas-drivers/renesas-pinctrl pinctrl-samsung/for-next linus/master v6.7-rc2]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Andy-Shevchenko/pinctrl-qcom-lpass-lpi-Remove-unused-member-in-struct-lpi_pingroup/20231124-043212
base: https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git devel
patch link: https://lore.kernel.org/r/20231123193355.3400852-7-andriy.shevchenko%40linux.intel.com
patch subject: [PATCH v2 06/21] pinctrl: equilibrium: Convert to use struct pingroup
config: i386-randconfig-141-20231124 (https://download.01.org/0day-ci/archive/20231124/[email protected]/config)
compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07)
reproduce: (https://download.01.org/0day-ci/archive/20231124/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
smatch warnings:
drivers/pinctrl/pinctrl-equilibrium.c:719 eqbr_build_groups() warn: unsigned 'grp->npins' is never less than zero.
vim +719 drivers/pinctrl/pinctrl-equilibrium.c
702
703 static int eqbr_build_groups(struct eqbr_pinctrl_drv_data *drvdata)
704 {
705 struct device *dev = drvdata->dev;
706 struct device_node *node = dev->of_node;
707 unsigned int *pins, *pinmux, pin_id, pinmux_id;
708 struct pingroup group, *grp = &group;
709 struct device_node *np;
710 struct property *prop;
711 int j, err;
712
713 for_each_child_of_node(node, np) {
714 prop = of_find_property(np, "groups", NULL);
715 if (!prop)
716 continue;
717
718 grp->npins = of_property_count_u32_elems(np, "pins");
> 719 if (grp->npins < 0) {
720 dev_err(dev, "No pins in the group: %s\n", prop->name);
721 of_node_put(np);
722 return -EINVAL;
723 }
724 grp->name = prop->value;
725 pins = devm_kcalloc(dev, grp->npins, sizeof(*pins), GFP_KERNEL);
726 if (!pins) {
727 of_node_put(np);
728 return -ENOMEM;
729 }
730 grp->pins = pins;
731
732 pinmux = devm_kcalloc(dev, grp->npins, sizeof(*pinmux), GFP_KERNEL);
733 if (!pinmux) {
734 of_node_put(np);
735 return -ENOMEM;
736 }
737
738 for (j = 0; j < grp->npins; j++) {
739 if (of_property_read_u32_index(np, "pins", j, &pin_id)) {
740 dev_err(dev, "Group %s: Read intel pins id failed\n",
741 grp->name);
742 of_node_put(np);
743 return -EINVAL;
744 }
745 if (pin_id >= drvdata->pctl_desc.npins) {
746 dev_err(dev, "Group %s: Invalid pin ID, idx: %d, pin %u\n",
747 grp->name, j, pin_id);
748 of_node_put(np);
749 return -EINVAL;
750 }
751 pins[j] = pin_id;
752 if (of_property_read_u32_index(np, "pinmux", j, &pinmux_id)) {
753 dev_err(dev, "Group %s: Read intel pinmux id failed\n",
754 grp->name);
755 of_node_put(np);
756 return -EINVAL;
757 }
758 pinmux[j] = pinmux_id;
759 }
760
761 err = pinctrl_generic_add_group(drvdata->pctl_dev,
762 grp->name, grp->pins, grp->npins,
763 pinmux);
764 if (err < 0) {
765 dev_err(dev, "Failed to register group %s\n", grp->name);
766 of_node_put(np);
767 return err;
768 }
769 memset(&group, 0, sizeof(group));
770 pinmux = NULL;
771 }
772
773 return 0;
774 }
775
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
On Fri, Nov 24, 2023 at 09:19:45PM +0800, kernel test robot wrote:
...
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <[email protected]>
> | Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
>
> smatch warnings:
> drivers/pinctrl/pinctrl-equilibrium.c:719 eqbr_build_groups() warn: unsigned 'grp->npins' is never less than zero.
Thank you for the report!
...
> 718 grp->npins = of_property_count_u32_elems(np, "pins");
> > 719 if (grp->npins < 0) {
> 720 dev_err(dev, "No pins in the group: %s\n", prop->name);
> 721 of_node_put(np);
> 722 return -EINVAL;
> 723 }
Surprisingly (to me) the _count_u32_elems() can return a negative error code...
Fine, I redo a bit the code by introducing a new patch that will use err instead
of ->npins (which sounds better approach anyway).
--
With Best Regards,
Andy Shevchenko
On Fri, Nov 24, 2023 at 11:17:53AM +0100, Linus Walleij wrote:
> On Thu, Nov 23, 2023 at 8:34 PM Andy Shevchenko
> <[email protected]> wrote:
...
> > Linus, assuming everything is fine, I can push this to my tree.
> > Or you can apply it (assumming all CIs and people are happy with
> > the series).
>
> I would give people some time to test the changes and ACK it,
> but admittedly it's a very tasty patch set and I am eager to merge
> it ASAP.
>
> Shall we give people a week and then we merge it?
Yes, and since it's again some small issues, I want to send a v3
next week (presumably on Monday).
--
With Best Regards,
Andy Shevchenko
Hi Andy,
kernel test robot noticed the following build errors:
[auto build test ERROR on linusw-pinctrl/devel]
[also build test ERROR on linusw-pinctrl/for-next next-20231124]
[cannot apply to geert-renesas-drivers/renesas-pinctrl pinctrl-samsung/for-next linus/master v6.7-rc2]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Andy-Shevchenko/pinctrl-qcom-lpass-lpi-Remove-unused-member-in-struct-lpi_pingroup/20231124-043212
base: https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git devel
patch link: https://lore.kernel.org/r/20231123193355.3400852-13-andriy.shevchenko%40linux.intel.com
patch subject: [PATCH v2 12/21] pinctrl: core: Embed struct pingroup into struct group_desc
config: i386-buildonly-randconfig-006-20231125 (https://download.01.org/0day-ci/archive/20231125/[email protected]/config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231125/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All error/warnings (new ones prefixed by >>):
In file included from drivers/pinctrl/pinctrl-ingenic.c:29:0:
drivers/pinctrl/core.h:217:21: error: initializer element is not constant
(struct group_desc) { \
^
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:200:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("mmc-1bit", jz4730_mmc_1bit, 1),
^~~~~~~~~~~~~~~~~
drivers/pinctrl/core.h:217:21: note: (near initialization for 'jz4730_groups')
(struct group_desc) { \
^
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:200:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("mmc-1bit", jz4730_mmc_1bit, 1),
^~~~~~~~~~~~~~~~~
drivers/pinctrl/core.h:217:21: error: initializer element is not constant
(struct group_desc) { \
^
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:296:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("mmc-1bit", jz4740_mmc_1bit, 0),
^~~~~~~~~~~~~~~~~
drivers/pinctrl/core.h:217:21: note: (near initialization for 'jz4740_groups')
(struct group_desc) { \
^
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:296:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("mmc-1bit", jz4740_mmc_1bit, 0),
^~~~~~~~~~~~~~~~~
In file included from include/linux/gpio/driver.h:13:0,
from drivers/pinctrl/pinctrl-ingenic.c:11:
>> include/linux/pinctrl/pinctrl.h:43:1: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
(struct pingroup) { \
^
drivers/pinctrl/core.h:218:9: note: in expansion of macro 'PINCTRL_PINGROUP'
.grp = PINCTRL_PINGROUP(_name, _pins, _num_pins), \
^~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:297:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("mmc-4bit", jz4740_mmc_4bit, 0),
^~~~~~~~~~~~~~~~~
include/linux/pinctrl/pinctrl.h:43:1: note: (near initialization for '(anonymous).grp.name')
(struct pingroup) { \
^
drivers/pinctrl/core.h:218:9: note: in expansion of macro 'PINCTRL_PINGROUP'
.grp = PINCTRL_PINGROUP(_name, _pins, _num_pins), \
^~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:297:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("mmc-4bit", jz4740_mmc_4bit, 0),
^~~~~~~~~~~~~~~~~
In file included from drivers/pinctrl/pinctrl-ingenic.c:29:0:
drivers/pinctrl/core.h:217:1: warning: missing braces around initializer [-Wmissing-braces]
(struct group_desc) { \
^
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:297:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("mmc-4bit", jz4740_mmc_4bit, 0),
^~~~~~~~~~~~~~~~~
>> drivers/pinctrl/core.h:217:1: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
(struct group_desc) { \
^
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:297:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("mmc-4bit", jz4740_mmc_4bit, 0),
^~~~~~~~~~~~~~~~~
drivers/pinctrl/core.h:217:1: note: (near initialization for 'jz4740_groups[1].grp.name')
(struct group_desc) { \
^
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:297:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("mmc-4bit", jz4740_mmc_4bit, 0),
^~~~~~~~~~~~~~~~~
drivers/pinctrl/core.h:217:1: error: initializer element is not constant
(struct group_desc) { \
^
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:297:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("mmc-4bit", jz4740_mmc_4bit, 0),
^~~~~~~~~~~~~~~~~
drivers/pinctrl/core.h:217:1: note: (near initialization for 'jz4740_groups[1].grp.name')
(struct group_desc) { \
^
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:297:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("mmc-4bit", jz4740_mmc_4bit, 0),
^~~~~~~~~~~~~~~~~
In file included from include/linux/gpio/driver.h:13:0,
from drivers/pinctrl/pinctrl-ingenic.c:11:
>> include/linux/pinctrl/pinctrl.h:43:1: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
(struct pingroup) { \
^
drivers/pinctrl/core.h:218:9: note: in expansion of macro 'PINCTRL_PINGROUP'
.grp = PINCTRL_PINGROUP(_name, _pins, _num_pins), \
^~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:298:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("uart0-data", jz4740_uart0_data, 1),
^~~~~~~~~~~~~~~~~
include/linux/pinctrl/pinctrl.h:43:1: note: (near initialization for '(anonymous).grp.name')
(struct pingroup) { \
^
drivers/pinctrl/core.h:218:9: note: in expansion of macro 'PINCTRL_PINGROUP'
.grp = PINCTRL_PINGROUP(_name, _pins, _num_pins), \
^~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:298:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("uart0-data", jz4740_uart0_data, 1),
^~~~~~~~~~~~~~~~~
In file included from drivers/pinctrl/pinctrl-ingenic.c:29:0:
drivers/pinctrl/core.h:217:1: warning: missing braces around initializer [-Wmissing-braces]
(struct group_desc) { \
^
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:298:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("uart0-data", jz4740_uart0_data, 1),
^~~~~~~~~~~~~~~~~
>> drivers/pinctrl/core.h:217:1: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
(struct group_desc) { \
^
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:298:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("uart0-data", jz4740_uart0_data, 1),
^~~~~~~~~~~~~~~~~
drivers/pinctrl/core.h:217:1: note: (near initialization for 'jz4740_groups[1].grp.pins')
(struct group_desc) { \
^
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:298:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("uart0-data", jz4740_uart0_data, 1),
^~~~~~~~~~~~~~~~~
drivers/pinctrl/core.h:217:1: error: initializer element is not constant
(struct group_desc) { \
^
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:298:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("uart0-data", jz4740_uart0_data, 1),
^~~~~~~~~~~~~~~~~
drivers/pinctrl/core.h:217:1: note: (near initialization for 'jz4740_groups[1].grp.pins')
(struct group_desc) { \
^
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:298:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("uart0-data", jz4740_uart0_data, 1),
^~~~~~~~~~~~~~~~~
In file included from include/linux/gpio/driver.h:13:0,
from drivers/pinctrl/pinctrl-ingenic.c:11:
>> include/linux/pinctrl/pinctrl.h:43:1: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
(struct pingroup) { \
^
drivers/pinctrl/core.h:218:9: note: in expansion of macro 'PINCTRL_PINGROUP'
.grp = PINCTRL_PINGROUP(_name, _pins, _num_pins), \
^~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:299:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("uart0-hwflow", jz4740_uart0_hwflow, 1),
^~~~~~~~~~~~~~~~~
include/linux/pinctrl/pinctrl.h:43:1: note: (near initialization for '(anonymous).grp.name')
(struct pingroup) { \
^
drivers/pinctrl/core.h:218:9: note: in expansion of macro 'PINCTRL_PINGROUP'
.grp = PINCTRL_PINGROUP(_name, _pins, _num_pins), \
^~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:299:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("uart0-hwflow", jz4740_uart0_hwflow, 1),
^~~~~~~~~~~~~~~~~
In file included from drivers/pinctrl/pinctrl-ingenic.c:29:0:
drivers/pinctrl/core.h:217:1: warning: missing braces around initializer [-Wmissing-braces]
(struct group_desc) { \
^
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:299:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("uart0-hwflow", jz4740_uart0_hwflow, 1),
^~~~~~~~~~~~~~~~~
>> drivers/pinctrl/core.h:217:1: warning: initialization makes integer from pointer without a cast [-Wint-conversion]
(struct group_desc) { \
^
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:299:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("uart0-hwflow", jz4740_uart0_hwflow, 1),
^~~~~~~~~~~~~~~~~
drivers/pinctrl/core.h:217:1: note: (near initialization for 'jz4740_groups[1].grp.npins')
(struct group_desc) { \
^
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:299:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("uart0-hwflow", jz4740_uart0_hwflow, 1),
^~~~~~~~~~~~~~~~~
drivers/pinctrl/core.h:217:1: error: initializer element is not constant
(struct group_desc) { \
^
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:299:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("uart0-hwflow", jz4740_uart0_hwflow, 1),
^~~~~~~~~~~~~~~~~
drivers/pinctrl/core.h:217:1: note: (near initialization for 'jz4740_groups[1].grp.npins')
(struct group_desc) { \
^
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:299:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("uart0-hwflow", jz4740_uart0_hwflow, 1),
^~~~~~~~~~~~~~~~~
In file included from include/linux/gpio/driver.h:13:0,
from drivers/pinctrl/pinctrl-ingenic.c:11:
>> include/linux/pinctrl/pinctrl.h:43:1: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
(struct pingroup) { \
^
drivers/pinctrl/core.h:218:9: note: in expansion of macro 'PINCTRL_PINGROUP'
.grp = PINCTRL_PINGROUP(_name, _pins, _num_pins), \
^~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:300:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("uart1-data", jz4740_uart1_data, 2),
^~~~~~~~~~~~~~~~~
include/linux/pinctrl/pinctrl.h:43:1: note: (near initialization for '(anonymous).grp.name')
(struct pingroup) { \
^
drivers/pinctrl/core.h:218:9: note: in expansion of macro 'PINCTRL_PINGROUP'
.grp = PINCTRL_PINGROUP(_name, _pins, _num_pins), \
^~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:300:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("uart1-data", jz4740_uart1_data, 2),
^~~~~~~~~~~~~~~~~
In file included from drivers/pinctrl/pinctrl-ingenic.c:29:0:
drivers/pinctrl/core.h:217:1: warning: missing braces around initializer [-Wmissing-braces]
(struct group_desc) { \
^
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:300:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("uart1-data", jz4740_uart1_data, 2),
^~~~~~~~~~~~~~~~~
>> drivers/pinctrl/core.h:217:1: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
(struct group_desc) { \
^
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:300:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("uart1-data", jz4740_uart1_data, 2),
^~~~~~~~~~~~~~~~~
drivers/pinctrl/core.h:217:1: note: (near initialization for 'jz4740_groups[1].name')
(struct group_desc) { \
^
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:300:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("uart1-data", jz4740_uart1_data, 2),
^~~~~~~~~~~~~~~~~
drivers/pinctrl/core.h:217:1: error: initializer element is not constant
(struct group_desc) { \
^
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:300:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("uart1-data", jz4740_uart1_data, 2),
^~~~~~~~~~~~~~~~~
drivers/pinctrl/core.h:217:1: note: (near initialization for 'jz4740_groups[1].name')
(struct group_desc) { \
^
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:300:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("uart1-data", jz4740_uart1_data, 2),
^~~~~~~~~~~~~~~~~
In file included from include/linux/gpio/driver.h:13:0,
from drivers/pinctrl/pinctrl-ingenic.c:11:
>> include/linux/pinctrl/pinctrl.h:43:1: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
(struct pingroup) { \
^
drivers/pinctrl/core.h:218:9: note: in expansion of macro 'PINCTRL_PINGROUP'
.grp = PINCTRL_PINGROUP(_name, _pins, _num_pins), \
^~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:301:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("lcd-8bit", jz4740_lcd_8bit, 0),
^~~~~~~~~~~~~~~~~
include/linux/pinctrl/pinctrl.h:43:1: note: (near initialization for '(anonymous).grp.name')
(struct pingroup) { \
^
drivers/pinctrl/core.h:218:9: note: in expansion of macro 'PINCTRL_PINGROUP'
.grp = PINCTRL_PINGROUP(_name, _pins, _num_pins), \
^~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:301:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("lcd-8bit", jz4740_lcd_8bit, 0),
^~~~~~~~~~~~~~~~~
In file included from drivers/pinctrl/pinctrl-ingenic.c:29:0:
drivers/pinctrl/core.h:217:1: warning: missing braces around initializer [-Wmissing-braces]
(struct group_desc) { \
^
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:301:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("lcd-8bit", jz4740_lcd_8bit, 0),
^~~~~~~~~~~~~~~~~
>> drivers/pinctrl/core.h:217:1: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
(struct group_desc) { \
^
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:301:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("lcd-8bit", jz4740_lcd_8bit, 0),
^~~~~~~~~~~~~~~~~
drivers/pinctrl/core.h:217:1: note: (near initialization for 'jz4740_groups[1].pins')
(struct group_desc) { \
^
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:301:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("lcd-8bit", jz4740_lcd_8bit, 0),
^~~~~~~~~~~~~~~~~
drivers/pinctrl/core.h:217:1: error: initializer element is not constant
(struct group_desc) { \
^
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:301:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("lcd-8bit", jz4740_lcd_8bit, 0),
^~~~~~~~~~~~~~~~~
drivers/pinctrl/core.h:217:1: note: (near initialization for 'jz4740_groups[1].pins')
(struct group_desc) { \
^
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:301:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("lcd-8bit", jz4740_lcd_8bit, 0),
^~~~~~~~~~~~~~~~~
In file included from include/linux/gpio/driver.h:13:0,
from drivers/pinctrl/pinctrl-ingenic.c:11:
>> include/linux/pinctrl/pinctrl.h:43:1: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
(struct pingroup) { \
^
drivers/pinctrl/core.h:218:9: note: in expansion of macro 'PINCTRL_PINGROUP'
.grp = PINCTRL_PINGROUP(_name, _pins, _num_pins), \
^~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:302:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("lcd-16bit", jz4740_lcd_16bit, 0),
^~~~~~~~~~~~~~~~~
include/linux/pinctrl/pinctrl.h:43:1: note: (near initialization for '(anonymous).grp.name')
(struct pingroup) { \
^
drivers/pinctrl/core.h:218:9: note: in expansion of macro 'PINCTRL_PINGROUP'
.grp = PINCTRL_PINGROUP(_name, _pins, _num_pins), \
^~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:302:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("lcd-16bit", jz4740_lcd_16bit, 0),
^~~~~~~~~~~~~~~~~
In file included from drivers/pinctrl/pinctrl-ingenic.c:29:0:
drivers/pinctrl/core.h:217:1: warning: missing braces around initializer [-Wmissing-braces]
(struct group_desc) { \
^
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:302:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("lcd-16bit", jz4740_lcd_16bit, 0),
^~~~~~~~~~~~~~~~~
>> drivers/pinctrl/core.h:217:1: warning: initialization makes integer from pointer without a cast [-Wint-conversion]
(struct group_desc) { \
^
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:302:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("lcd-16bit", jz4740_lcd_16bit, 0),
^~~~~~~~~~~~~~~~~
drivers/pinctrl/core.h:217:1: note: (near initialization for 'jz4740_groups[1].num_pins')
(struct group_desc) { \
^
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:302:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("lcd-16bit", jz4740_lcd_16bit, 0),
^~~~~~~~~~~~~~~~~
drivers/pinctrl/core.h:217:1: error: initializer element is not constant
(struct group_desc) { \
^
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:302:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("lcd-16bit", jz4740_lcd_16bit, 0),
^~~~~~~~~~~~~~~~~
drivers/pinctrl/core.h:217:1: note: (near initialization for 'jz4740_groups[1].num_pins')
(struct group_desc) { \
^
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:302:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("lcd-16bit", jz4740_lcd_16bit, 0),
^~~~~~~~~~~~~~~~~
In file included from include/linux/gpio/driver.h:13:0,
from drivers/pinctrl/pinctrl-ingenic.c:11:
>> include/linux/pinctrl/pinctrl.h:43:1: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
(struct pingroup) { \
^
drivers/pinctrl/core.h:218:9: note: in expansion of macro 'PINCTRL_PINGROUP'
.grp = PINCTRL_PINGROUP(_name, _pins, _num_pins), \
^~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:303:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("lcd-18bit", jz4740_lcd_18bit, 0),
^~~~~~~~~~~~~~~~~
include/linux/pinctrl/pinctrl.h:43:1: note: (near initialization for '(anonymous).grp.name')
(struct pingroup) { \
^
drivers/pinctrl/core.h:218:9: note: in expansion of macro 'PINCTRL_PINGROUP'
.grp = PINCTRL_PINGROUP(_name, _pins, _num_pins), \
^~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:303:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("lcd-18bit", jz4740_lcd_18bit, 0),
^~~~~~~~~~~~~~~~~
In file included from drivers/pinctrl/pinctrl-ingenic.c:29:0:
drivers/pinctrl/core.h:217:1: warning: missing braces around initializer [-Wmissing-braces]
(struct group_desc) { \
^
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:303:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("lcd-18bit", jz4740_lcd_18bit, 0),
^~~~~~~~~~~~~~~~~
drivers/pinctrl/core.h:217:1: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
(struct group_desc) { \
^
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:303:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("lcd-18bit", jz4740_lcd_18bit, 0),
^~~~~~~~~~~~~~~~~
drivers/pinctrl/core.h:217:1: error: initializer element is not constant
(struct group_desc) { \
^
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:303:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("lcd-18bit", jz4740_lcd_18bit, 0),
^~~~~~~~~~~~~~~~~
drivers/pinctrl/core.h:217:1: note: (near initialization for 'jz4740_groups[1].data')
(struct group_desc) { \
^
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:303:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("lcd-18bit", jz4740_lcd_18bit, 0),
^~~~~~~~~~~~~~~~~
In file included from include/linux/gpio/driver.h:13:0,
from drivers/pinctrl/pinctrl-ingenic.c:11:
>> include/linux/pinctrl/pinctrl.h:43:1: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
(struct pingroup) { \
^
drivers/pinctrl/core.h:218:9: note: in expansion of macro 'PINCTRL_PINGROUP'
.grp = PINCTRL_PINGROUP(_name, _pins, _num_pins), \
^~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:304:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("lcd-special", jz4740_lcd_special, 0),
^~~~~~~~~~~~~~~~~
include/linux/pinctrl/pinctrl.h:43:1: note: (near initialization for '(anonymous).grp.name')
(struct pingroup) { \
^
drivers/pinctrl/core.h:218:9: note: in expansion of macro 'PINCTRL_PINGROUP'
.grp = PINCTRL_PINGROUP(_name, _pins, _num_pins), \
^~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:304:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("lcd-special", jz4740_lcd_special, 0),
^~~~~~~~~~~~~~~~~
In file included from drivers/pinctrl/pinctrl-ingenic.c:29:0:
drivers/pinctrl/core.h:217:1: warning: missing braces around initializer [-Wmissing-braces]
(struct group_desc) { \
^
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:304:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("lcd-special", jz4740_lcd_special, 0),
^~~~~~~~~~~~~~~~~
>> drivers/pinctrl/core.h:217:1: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
(struct group_desc) { \
^
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:304:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("lcd-special", jz4740_lcd_special, 0),
^~~~~~~~~~~~~~~~~
drivers/pinctrl/core.h:217:1: note: (near initialization for 'jz4740_groups[2].grp.name')
(struct group_desc) { \
^
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:304:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("lcd-special", jz4740_lcd_special, 0),
^~~~~~~~~~~~~~~~~
drivers/pinctrl/core.h:217:1: error: initializer element is not constant
(struct group_desc) { \
^
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:304:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("lcd-special", jz4740_lcd_special, 0),
^~~~~~~~~~~~~~~~~
drivers/pinctrl/core.h:217:1: note: (near initialization for 'jz4740_groups[2].grp.name')
(struct group_desc) { \
^
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:304:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("lcd-special", jz4740_lcd_special, 0),
^~~~~~~~~~~~~~~~~
In file included from include/linux/gpio/driver.h:13:0,
from drivers/pinctrl/pinctrl-ingenic.c:11:
>> include/linux/pinctrl/pinctrl.h:43:1: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
(struct pingroup) { \
^
drivers/pinctrl/core.h:218:9: note: in expansion of macro 'PINCTRL_PINGROUP'
.grp = PINCTRL_PINGROUP(_name, _pins, _num_pins), \
^~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:305:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("lcd-generic", jz4740_lcd_generic, 0),
^~~~~~~~~~~~~~~~~
include/linux/pinctrl/pinctrl.h:43:1: note: (near initialization for '(anonymous).grp.name')
(struct pingroup) { \
^
drivers/pinctrl/core.h:218:9: note: in expansion of macro 'PINCTRL_PINGROUP'
.grp = PINCTRL_PINGROUP(_name, _pins, _num_pins), \
^~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:305:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("lcd-generic", jz4740_lcd_generic, 0),
^~~~~~~~~~~~~~~~~
In file included from drivers/pinctrl/pinctrl-ingenic.c:29:0:
drivers/pinctrl/core.h:217:1: warning: missing braces around initializer [-Wmissing-braces]
(struct group_desc) { \
^
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:305:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("lcd-generic", jz4740_lcd_generic, 0),
^~~~~~~~~~~~~~~~~
>> drivers/pinctrl/core.h:217:1: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
(struct group_desc) { \
^
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:305:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("lcd-generic", jz4740_lcd_generic, 0),
^~~~~~~~~~~~~~~~~
drivers/pinctrl/core.h:217:1: note: (near initialization for 'jz4740_groups[2].grp.pins')
(struct group_desc) { \
^
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:305:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("lcd-generic", jz4740_lcd_generic, 0),
^~~~~~~~~~~~~~~~~
drivers/pinctrl/core.h:217:1: error: initializer element is not constant
(struct group_desc) { \
^
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:305:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("lcd-generic", jz4740_lcd_generic, 0),
^~~~~~~~~~~~~~~~~
drivers/pinctrl/core.h:217:1: note: (near initialization for 'jz4740_groups[2].grp.pins')
(struct group_desc) { \
^
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:305:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("lcd-generic", jz4740_lcd_generic, 0),
^~~~~~~~~~~~~~~~~
In file included from include/linux/gpio/driver.h:13:0,
from drivers/pinctrl/pinctrl-ingenic.c:11:
>> include/linux/pinctrl/pinctrl.h:43:1: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
(struct pingroup) { \
^
drivers/pinctrl/core.h:218:9: note: in expansion of macro 'PINCTRL_PINGROUP'
.grp = PINCTRL_PINGROUP(_name, _pins, _num_pins), \
^~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:306:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("nand-cs1", jz4740_nand_cs1, 0),
^~~~~~~~~~~~~~~~~
include/linux/pinctrl/pinctrl.h:43:1: note: (near initialization for '(anonymous).grp.name')
(struct pingroup) { \
^
drivers/pinctrl/core.h:218:9: note: in expansion of macro 'PINCTRL_PINGROUP'
.grp = PINCTRL_PINGROUP(_name, _pins, _num_pins), \
^~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:306:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("nand-cs1", jz4740_nand_cs1, 0),
^~~~~~~~~~~~~~~~~
In file included from drivers/pinctrl/pinctrl-ingenic.c:29:0:
drivers/pinctrl/core.h:217:1: warning: missing braces around initializer [-Wmissing-braces]
(struct group_desc) { \
^
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:306:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("nand-cs1", jz4740_nand_cs1, 0),
^~~~~~~~~~~~~~~~~
>> drivers/pinctrl/core.h:217:1: warning: initialization makes integer from pointer without a cast [-Wint-conversion]
(struct group_desc) { \
^
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:306:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("nand-cs1", jz4740_nand_cs1, 0),
^~~~~~~~~~~~~~~~~
drivers/pinctrl/core.h:217:1: note: (near initialization for 'jz4740_groups[2].grp.npins')
(struct group_desc) { \
^
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:306:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("nand-cs1", jz4740_nand_cs1, 0),
^~~~~~~~~~~~~~~~~
drivers/pinctrl/core.h:217:1: error: initializer element is not constant
(struct group_desc) { \
^
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:306:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("nand-cs1", jz4740_nand_cs1, 0),
^~~~~~~~~~~~~~~~~
drivers/pinctrl/core.h:217:1: note: (near initialization for 'jz4740_groups[2].grp.npins')
(struct group_desc) { \
^
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:306:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("nand-cs1", jz4740_nand_cs1, 0),
^~~~~~~~~~~~~~~~~
In file included from include/linux/gpio/driver.h:13:0,
from drivers/pinctrl/pinctrl-ingenic.c:11:
>> include/linux/pinctrl/pinctrl.h:43:1: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
(struct pingroup) { \
^
drivers/pinctrl/core.h:218:9: note: in expansion of macro 'PINCTRL_PINGROUP'
.grp = PINCTRL_PINGROUP(_name, _pins, _num_pins), \
^~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:307:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("nand-cs2", jz4740_nand_cs2, 0),
^~~~~~~~~~~~~~~~~
include/linux/pinctrl/pinctrl.h:43:1: note: (near initialization for '(anonymous).grp.name')
(struct pingroup) { \
^
drivers/pinctrl/core.h:218:9: note: in expansion of macro 'PINCTRL_PINGROUP'
.grp = PINCTRL_PINGROUP(_name, _pins, _num_pins), \
^~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:307:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("nand-cs2", jz4740_nand_cs2, 0),
^~~~~~~~~~~~~~~~~
In file included from drivers/pinctrl/pinctrl-ingenic.c:29:0:
drivers/pinctrl/core.h:217:1: warning: missing braces around initializer [-Wmissing-braces]
(struct group_desc) { \
^
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:307:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("nand-cs2", jz4740_nand_cs2, 0),
^~~~~~~~~~~~~~~~~
drivers/pinctrl/core.h:217:1: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
(struct group_desc) { \
^
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:307:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("nand-cs2", jz4740_nand_cs2, 0),
^~~~~~~~~~~~~~~~~
drivers/pinctrl/core.h:217:1: note: (near initialization for 'jz4740_groups[2].name')
(struct group_desc) { \
^
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:307:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("nand-cs2", jz4740_nand_cs2, 0),
^~~~~~~~~~~~~~~~~
drivers/pinctrl/core.h:217:1: error: initializer element is not constant
(struct group_desc) { \
^
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:307:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("nand-cs2", jz4740_nand_cs2, 0),
^~~~~~~~~~~~~~~~~
drivers/pinctrl/core.h:217:1: note: (near initialization for 'jz4740_groups[2].name')
(struct group_desc) { \
^
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:307:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("nand-cs2", jz4740_nand_cs2, 0),
^~~~~~~~~~~~~~~~~
In file included from include/linux/gpio/driver.h:13:0,
from drivers/pinctrl/pinctrl-ingenic.c:11:
include/linux/pinctrl/pinctrl.h:43:1: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
(struct pingroup) { \
^
drivers/pinctrl/core.h:218:9: note: in expansion of macro 'PINCTRL_PINGROUP'
.grp = PINCTRL_PINGROUP(_name, _pins, _num_pins), \
^~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:308:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("nand-cs3", jz4740_nand_cs3, 0),
^~~~~~~~~~~~~~~~~
include/linux/pinctrl/pinctrl.h:43:1: note: (near initialization for '(anonymous).grp.name')
(struct pingroup) { \
^
drivers/pinctrl/core.h:218:9: note: in expansion of macro 'PINCTRL_PINGROUP'
.grp = PINCTRL_PINGROUP(_name, _pins, _num_pins), \
^~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), (void *)(func))
^~~~~~~~~~~~~~~~~~
drivers/pinctrl/pinctrl-ingenic.c:308:2: note: in expansion of macro 'INGENIC_PIN_GROUP'
INGENIC_PIN_GROUP("nand-cs3", jz4740_nand_cs3, 0),
^~~~~~~~~~~~~~~~~
In file included from drivers/pinctrl/pinctrl-ingenic.c:29:0:
drivers/pinctrl/core.h:217:1: warning: missing braces around initializer [-Wmissing-braces]
(struct group_desc) { \
^
drivers/pinctrl/pinctrl-ingenic.c:89:2: note: in expansion of macro 'PINCTRL_GROUP_DESC'
vim +43 include/linux/pinctrl/pinctrl.h
003cbe04617159 Basavaraj Natikar 2022-06-01 40
003cbe04617159 Basavaraj Natikar 2022-06-01 41 /* Convenience macro to define a single named or anonymous pingroup */
003cbe04617159 Basavaraj Natikar 2022-06-01 42 #define PINCTRL_PINGROUP(_name, _pins, _npins) \
003cbe04617159 Basavaraj Natikar 2022-06-01 @43 (struct pingroup) { \
003cbe04617159 Basavaraj Natikar 2022-06-01 44 .name = _name, \
003cbe04617159 Basavaraj Natikar 2022-06-01 45 .pins = _pins, \
003cbe04617159 Basavaraj Natikar 2022-06-01 46 .npins = _npins, \
003cbe04617159 Basavaraj Natikar 2022-06-01 47 }
003cbe04617159 Basavaraj Natikar 2022-06-01 48
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Andy Shevchenko wrote:
> Convert drivers to use grp member embedded in struct group_desc.
>
> Signed-off-by: Andy Shevchenko <[email protected]>
Reviewed-by: Emil Renner Berthing <[email protected]>
> ---
> drivers/pinctrl/starfive/pinctrl-starfive-jh7100.c | 8 ++++----
> drivers/pinctrl/starfive/pinctrl-starfive-jh7110.c | 8 ++++----
> 2 files changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/pinctrl/starfive/pinctrl-starfive-jh7100.c b/drivers/pinctrl/starfive/pinctrl-starfive-jh7100.c
> index ea70b8c61679..21bfbbaede72 100644
> --- a/drivers/pinctrl/starfive/pinctrl-starfive-jh7100.c
> +++ b/drivers/pinctrl/starfive/pinctrl-starfive-jh7100.c
> @@ -654,7 +654,7 @@ static int starfive_set_mux(struct pinctrl_dev *pctldev,
> return -EINVAL;
>
> pinmux = group->data;
> - for (i = 0; i < group->num_pins; i++) {
> + for (i = 0; i < group->grp.npins; i++) {
> u32 v = pinmux[i];
> unsigned int gpio = starfive_pinmux_to_gpio(v);
> u32 dout = starfive_pinmux_to_dout(v);
> @@ -797,7 +797,7 @@ static int starfive_pinconf_group_get(struct pinctrl_dev *pctldev,
> if (!group)
> return -EINVAL;
>
> - return starfive_pinconf_get(pctldev, group->pins[0], config);
> + return starfive_pinconf_get(pctldev, group->grp.pins[0], config);
> }
>
> static int starfive_pinconf_group_set(struct pinctrl_dev *pctldev,
> @@ -876,8 +876,8 @@ static int starfive_pinconf_group_set(struct pinctrl_dev *pctldev,
> }
> }
>
> - for (i = 0; i < group->num_pins; i++)
> - starfive_padctl_rmw(sfp, group->pins[i], mask, value);
> + for (i = 0; i < group->grp.npins; i++)
> + starfive_padctl_rmw(sfp, group->grp.pins[i], mask, value);
>
> return 0;
> }
> diff --git a/drivers/pinctrl/starfive/pinctrl-starfive-jh7110.c b/drivers/pinctrl/starfive/pinctrl-starfive-jh7110.c
> index 9d71e8c13310..60160965cd29 100644
> --- a/drivers/pinctrl/starfive/pinctrl-starfive-jh7110.c
> +++ b/drivers/pinctrl/starfive/pinctrl-starfive-jh7110.c
> @@ -307,7 +307,7 @@ static int jh7110_set_mux(struct pinctrl_dev *pctldev,
> return -EINVAL;
>
> pinmux = group->data;
> - for (i = 0; i < group->num_pins; i++) {
> + for (i = 0; i < group->grp.npins; i++) {
> u32 v = pinmux[i];
>
> if (info->jh7110_set_one_pin_mux)
> @@ -437,7 +437,7 @@ static int jh7110_pinconf_group_get(struct pinctrl_dev *pctldev,
> if (!group)
> return -EINVAL;
>
> - return jh7110_pinconf_get(pctldev, group->pins[0], config);
> + return jh7110_pinconf_get(pctldev, group->grp.pins[0], config);
> }
>
> static int jh7110_pinconf_group_set(struct pinctrl_dev *pctldev,
> @@ -508,8 +508,8 @@ static int jh7110_pinconf_group_set(struct pinctrl_dev *pctldev,
> }
> }
>
> - for (i = 0; i < group->num_pins; i++)
> - jh7110_padcfg_rmw(sfp, group->pins[i], mask, value);
> + for (i = 0; i < group->grp.npins; i++)
> + jh7110_padcfg_rmw(sfp, group->grp.pins[i], mask, value);
>
> return 0;
> }
> --
> 2.43.0.rc1.1.gbec44491f096
>
On 11/23/23 11:31, Andy Shevchenko wrote:
> Convert drivers to use grp member embedded in struct group_desc.
>
> Signed-off-by: Andy Shevchenko <[email protected]>
Took the whole series, applied it to pinctrl/for-next and did not see
any regressions on Northstar:
Tested-by: Florian Fainelli <[email protected]>
Reviewed-by: Florian Fainelli <[email protected]>
--
Florian
On Sat, Nov 25, 2023 at 07:39:02AM +0800, kernel test robot wrote:
> Hi Andy,
>
> kernel test robot noticed the following build errors:
> [also build test ERROR on linusw-pinctrl/for-next next-20231124]
Hmm... I have compiled tested on Linux Next it several times, I can't reproduce
this neither with GCC nor with LLVM.
--
With Best Regards,
Andy Shevchenko
On Tue, Nov 28, 2023 at 05:53:21PM +0200, Andy Shevchenko wrote:
> On Sat, Nov 25, 2023 at 07:39:02AM +0800, kernel test robot wrote:
> > Hi Andy,
> >
> > kernel test robot noticed the following build errors:
>
> > [also build test ERROR on linusw-pinctrl/for-next next-20231124]
>
> Hmm... I have compiled tested on Linux Next it several times, I can't reproduce
> this neither with GCC nor with LLVM.
Actually it rings a bell that some versions of GCC have a bug (?) that they may
not identify initializations like this to be converted to constants as we are
using compound literal it should make no difference.
--
With Best Regards,
Andy Shevchenko