All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 00/17] pinctrl: Convert struct group_desc to use struct pingroup
@ 2023-11-22 16:35 ` Andy Shevchenko
  0 siblings, 0 replies; 50+ messages in thread
From: Andy Shevchenko @ 2023-11-22 16:35 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	Rasmus Villemoes, Krzysztof Kozlowski, Uwe Kleine-König,
	Geert Uytterhoeven, Biju Das, Claudiu Beznea, Jianlong Huang,
	linux-arm-kernel, linux-gpio, linux-kernel, linux-mediatek,
	openbmc, linux-mips, linux-arm-msm, linux-renesas-soc
  Cc: Ray Jui, Scott Branden, Broadcom internal kernel review list,
	Dong Aisheng, Fabio Estevam, Shawn Guo, Jacky Bai,
	Pengutronix Kernel Team, Sascha Hauer, NXP Linux Team, Sean Wang,
	Jonathan Neuschäfer, Paul Cercueil, Lakshmi Sowjanya D,
	Bjorn Andersson, Andy Gross, Konrad Dybcio, Emil Renner Berthing,
	Hal Feng

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.

Andy Shevchenko (17):
  pinctrl: equilibrium: Convert to use struct pingroup
  pinctrl: nuvoton: Convert to use struct pingroup and
    PINCTRL_PINGROUP()
  pinctrl: qcom: lpass-lpi: Replace kernel.h with what is being used
  pinctrl: qcom: lpass-lpi: Remove unused member in struct lpi_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                        | 11 ++---
 drivers/pinctrl/core.h                        | 17 ++++---
 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         | 36 +++++++--------
 drivers/pinctrl/pinctrl-ingenic.c             | 27 +++++-------
 drivers/pinctrl/pinctrl-keembay.c             | 11 +++--
 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       |  4 +-
 drivers/pinctrl/renesas/pinctrl-rzv2m.c       |  4 +-
 .../starfive/pinctrl-starfive-jh7100.c        |  8 ++--
 .../starfive/pinctrl-starfive-jh7110.c        |  8 ++--
 26 files changed, 102 insertions(+), 285 deletions(-)

-- 
2.43.0.rc1.1.gbec44491f096


^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v1 00/17] pinctrl: Convert struct group_desc to use struct pingroup
@ 2023-11-22 16:35 ` Andy Shevchenko
  0 siblings, 0 replies; 50+ messages in thread
From: Andy Shevchenko @ 2023-11-22 16:35 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	Rasmus Villemoes, Krzysztof Kozlowski, Uwe Kleine-König,
	Geert Uytterhoeven, Biju Das, Claudiu Beznea, Jianlong Huang,
	linux-arm-kernel, linux-gpio, linux-kernel, linux-mediatek,
	openbmc, linux-mips, linux-arm-msm, linux-renesas-soc
  Cc: Ray Jui, Scott Branden, Broadcom internal kernel review list,
	Dong Aisheng, Fabio Estevam, Shawn Guo, Jacky Bai,
	Pengutronix Kernel Team, Sascha Hauer, NXP Linux Team, Sean Wang,
	Jonathan Neuschäfer, Paul Cercueil, Lakshmi Sowjanya D,
	Bjorn Andersson, Andy Gross, Konrad Dybcio, Emil Renner Berthing,
	Hal Feng

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.

Andy Shevchenko (17):
  pinctrl: equilibrium: Convert to use struct pingroup
  pinctrl: nuvoton: Convert to use struct pingroup and
    PINCTRL_PINGROUP()
  pinctrl: qcom: lpass-lpi: Replace kernel.h with what is being used
  pinctrl: qcom: lpass-lpi: Remove unused member in struct lpi_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                        | 11 ++---
 drivers/pinctrl/core.h                        | 17 ++++---
 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         | 36 +++++++--------
 drivers/pinctrl/pinctrl-ingenic.c             | 27 +++++-------
 drivers/pinctrl/pinctrl-keembay.c             | 11 +++--
 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       |  4 +-
 drivers/pinctrl/renesas/pinctrl-rzv2m.c       |  4 +-
 .../starfive/pinctrl-starfive-jh7100.c        |  8 ++--
 .../starfive/pinctrl-starfive-jh7110.c        |  8 ++--
 26 files changed, 102 insertions(+), 285 deletions(-)

-- 
2.43.0.rc1.1.gbec44491f096


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v1 01/17] pinctrl: equilibrium: Convert to use struct pingroup
  2023-11-22 16:35 ` Andy Shevchenko
@ 2023-11-22 16:35   ` Andy Shevchenko
  -1 siblings, 0 replies; 50+ messages in thread
From: Andy Shevchenko @ 2023-11-22 16:35 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	Rasmus Villemoes, Krzysztof Kozlowski, Uwe Kleine-König,
	Geert Uytterhoeven, Biju Das, Claudiu Beznea, Jianlong Huang,
	linux-arm-kernel, linux-gpio, linux-kernel, linux-mediatek,
	openbmc, linux-mips, linux-arm-msm, linux-renesas-soc
  Cc: Ray Jui, Scott Branden, Broadcom internal kernel review list,
	Dong Aisheng, Fabio Estevam, Shawn Guo, Jacky Bai,
	Pengutronix Kernel Team, Sascha Hauer, NXP Linux Team, Sean Wang,
	Jonathan Neuschäfer, Paul Cercueil, Lakshmi Sowjanya D,
	Bjorn Andersson, Andy Gross, Konrad Dybcio, Emil Renner Berthing,
	Hal Feng

The pin control header provides struct pingroup.
Utilize it instead of open coded variants in the driver.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/pinctrl/pinctrl-equilibrium.c | 32 +++++++++++++--------------
 1 file changed, 15 insertions(+), 17 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-equilibrium.c b/drivers/pinctrl/pinctrl-equilibrium.c
index 5b5ddf7e5d0e..9202a60b4ec7 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 *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,55 +715,53 @@ 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;
-		group.pins = devm_kcalloc(dev, group.num_pins,
-					  sizeof(*(group.pins)), GFP_KERNEL);
-		if (!group.pins) {
+		grp->name = prop->value;
+		grp->pins = devm_kcalloc(dev, grp->npins, sizeof(*grp->pins), GFP_KERNEL);
+		if (!grp->pins) {
 			of_node_put(np);
 			return -ENOMEM;
 		}
 
-		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;
 			}
-			group.pins[j] = pin_id;
+			grp->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->num_pins,
 						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


^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH v1 01/17] pinctrl: equilibrium: Convert to use struct pingroup
@ 2023-11-22 16:35   ` Andy Shevchenko
  0 siblings, 0 replies; 50+ messages in thread
From: Andy Shevchenko @ 2023-11-22 16:35 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	Rasmus Villemoes, Krzysztof Kozlowski, Uwe Kleine-König,
	Geert Uytterhoeven, Biju Das, Claudiu Beznea, Jianlong Huang,
	linux-arm-kernel, linux-gpio, linux-kernel, linux-mediatek,
	openbmc, linux-mips, linux-arm-msm, linux-renesas-soc
  Cc: Ray Jui, Scott Branden, Broadcom internal kernel review list,
	Dong Aisheng, Fabio Estevam, Shawn Guo, Jacky Bai,
	Pengutronix Kernel Team, Sascha Hauer, NXP Linux Team, Sean Wang,
	Jonathan Neuschäfer, Paul Cercueil, Lakshmi Sowjanya D,
	Bjorn Andersson, Andy Gross, Konrad Dybcio, Emil Renner Berthing,
	Hal Feng

The pin control header provides struct pingroup.
Utilize it instead of open coded variants in the driver.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/pinctrl/pinctrl-equilibrium.c | 32 +++++++++++++--------------
 1 file changed, 15 insertions(+), 17 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-equilibrium.c b/drivers/pinctrl/pinctrl-equilibrium.c
index 5b5ddf7e5d0e..9202a60b4ec7 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 *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,55 +715,53 @@ 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;
-		group.pins = devm_kcalloc(dev, group.num_pins,
-					  sizeof(*(group.pins)), GFP_KERNEL);
-		if (!group.pins) {
+		grp->name = prop->value;
+		grp->pins = devm_kcalloc(dev, grp->npins, sizeof(*grp->pins), GFP_KERNEL);
+		if (!grp->pins) {
 			of_node_put(np);
 			return -ENOMEM;
 		}
 
-		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;
 			}
-			group.pins[j] = pin_id;
+			grp->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->num_pins,
 						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


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH v1 02/17] pinctrl: nuvoton: Convert to use struct pingroup and PINCTRL_PINGROUP()
  2023-11-22 16:35 ` Andy Shevchenko
@ 2023-11-22 16:35   ` Andy Shevchenko
  -1 siblings, 0 replies; 50+ messages in thread
From: Andy Shevchenko @ 2023-11-22 16:35 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	Rasmus Villemoes, Krzysztof Kozlowski, Uwe Kleine-König,
	Geert Uytterhoeven, Biju Das, Claudiu Beznea, Jianlong Huang,
	linux-arm-kernel, linux-gpio, linux-kernel, linux-mediatek,
	openbmc, linux-mips, linux-arm-msm, linux-renesas-soc
  Cc: Ray Jui, Scott Branden, Broadcom internal kernel review list,
	Dong Aisheng, Fabio Estevam, Shawn Guo, Jacky Bai,
	Pengutronix Kernel Team, Sascha Hauer, NXP Linux Team, Sean Wang,
	Jonathan Neuschäfer, Paul Cercueil, Lakshmi Sowjanya D,
	Bjorn Andersson, Andy Gross, Konrad Dybcio, Emil Renner Berthing,
	Hal Feng

The pin control header provides struct pingroup and PINCTRL_PINGROUP() macro.
Utilize them instead of open coded variants in the driver.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 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


^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH v1 02/17] pinctrl: nuvoton: Convert to use struct pingroup and PINCTRL_PINGROUP()
@ 2023-11-22 16:35   ` Andy Shevchenko
  0 siblings, 0 replies; 50+ messages in thread
From: Andy Shevchenko @ 2023-11-22 16:35 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	Rasmus Villemoes, Krzysztof Kozlowski, Uwe Kleine-König,
	Geert Uytterhoeven, Biju Das, Claudiu Beznea, Jianlong Huang,
	linux-arm-kernel, linux-gpio, linux-kernel, linux-mediatek,
	openbmc, linux-mips, linux-arm-msm, linux-renesas-soc
  Cc: Ray Jui, Scott Branden, Broadcom internal kernel review list,
	Dong Aisheng, Fabio Estevam, Shawn Guo, Jacky Bai,
	Pengutronix Kernel Team, Sascha Hauer, NXP Linux Team, Sean Wang,
	Jonathan Neuschäfer, Paul Cercueil, Lakshmi Sowjanya D,
	Bjorn Andersson, Andy Gross, Konrad Dybcio, Emil Renner Berthing,
	Hal Feng

The pin control header provides struct pingroup and PINCTRL_PINGROUP() macro.
Utilize them instead of open coded variants in the driver.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 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


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH v1 03/17] pinctrl: qcom: lpass-lpi: Replace kernel.h with what is being used
  2023-11-22 16:35 ` Andy Shevchenko
@ 2023-11-22 16:35   ` Andy Shevchenko
  -1 siblings, 0 replies; 50+ messages in thread
From: Andy Shevchenko @ 2023-11-22 16:35 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	Rasmus Villemoes, Krzysztof Kozlowski, Uwe Kleine-König,
	Geert Uytterhoeven, Biju Das, Claudiu Beznea, Jianlong Huang,
	linux-arm-kernel, linux-gpio, linux-kernel, linux-mediatek,
	openbmc, linux-mips, linux-arm-msm, linux-renesas-soc
  Cc: Ray Jui, Scott Branden, Broadcom internal kernel review list,
	Dong Aisheng, Fabio Estevam, Shawn Guo, Jacky Bai,
	Pengutronix Kernel Team, Sascha Hauer, NXP Linux Team, Sean Wang,
	Jonathan Neuschäfer, Paul Cercueil, Lakshmi Sowjanya D,
	Bjorn Andersson, Andy Gross, Konrad Dybcio, Emil Renner Berthing,
	Hal Feng

Replace kernel.h with what exactly is being used, i.e. array_size.h.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/pinctrl/qcom/pinctrl-lpass-lpi.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pinctrl/qcom/pinctrl-lpass-lpi.h b/drivers/pinctrl/qcom/pinctrl-lpass-lpi.h
index 206b2c0ca828..2017bc80314d 100644
--- a/drivers/pinctrl/qcom/pinctrl-lpass-lpi.h
+++ b/drivers/pinctrl/qcom/pinctrl-lpass-lpi.h
@@ -6,8 +6,8 @@
 #ifndef __PINCTRL_LPASS_LPI_H__
 #define __PINCTRL_LPASS_LPI_H__
 
+#include <linux/array_size.h>
 #include <linux/bits.h>
-#include <linux/kernel.h>
 
 #include "../core.h"
 
-- 
2.43.0.rc1.1.gbec44491f096


^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH v1 03/17] pinctrl: qcom: lpass-lpi: Replace kernel.h with what is being used
@ 2023-11-22 16:35   ` Andy Shevchenko
  0 siblings, 0 replies; 50+ messages in thread
From: Andy Shevchenko @ 2023-11-22 16:35 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	Rasmus Villemoes, Krzysztof Kozlowski, Uwe Kleine-König,
	Geert Uytterhoeven, Biju Das, Claudiu Beznea, Jianlong Huang,
	linux-arm-kernel, linux-gpio, linux-kernel, linux-mediatek,
	openbmc, linux-mips, linux-arm-msm, linux-renesas-soc
  Cc: Ray Jui, Scott Branden, Broadcom internal kernel review list,
	Dong Aisheng, Fabio Estevam, Shawn Guo, Jacky Bai,
	Pengutronix Kernel Team, Sascha Hauer, NXP Linux Team, Sean Wang,
	Jonathan Neuschäfer, Paul Cercueil, Lakshmi Sowjanya D,
	Bjorn Andersson, Andy Gross, Konrad Dybcio, Emil Renner Berthing,
	Hal Feng

Replace kernel.h with what exactly is being used, i.e. array_size.h.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/pinctrl/qcom/pinctrl-lpass-lpi.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pinctrl/qcom/pinctrl-lpass-lpi.h b/drivers/pinctrl/qcom/pinctrl-lpass-lpi.h
index 206b2c0ca828..2017bc80314d 100644
--- a/drivers/pinctrl/qcom/pinctrl-lpass-lpi.h
+++ b/drivers/pinctrl/qcom/pinctrl-lpass-lpi.h
@@ -6,8 +6,8 @@
 #ifndef __PINCTRL_LPASS_LPI_H__
 #define __PINCTRL_LPASS_LPI_H__
 
+#include <linux/array_size.h>
 #include <linux/bits.h>
-#include <linux/kernel.h>
 
 #include "../core.h"
 
-- 
2.43.0.rc1.1.gbec44491f096


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH v1 04/17] pinctrl: qcom: lpass-lpi: Remove unused member in struct lpi_pingroup
  2023-11-22 16:35 ` Andy Shevchenko
@ 2023-11-22 16:35   ` Andy Shevchenko
  -1 siblings, 0 replies; 50+ messages in thread
From: Andy Shevchenko @ 2023-11-22 16:35 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	Rasmus Villemoes, Krzysztof Kozlowski, Uwe Kleine-König,
	Geert Uytterhoeven, Biju Das, Claudiu Beznea, Jianlong Huang,
	linux-arm-kernel, linux-gpio, linux-kernel, linux-mediatek,
	openbmc, linux-mips, linux-arm-msm, linux-renesas-soc
  Cc: Ray Jui, Scott Branden, Broadcom internal kernel review list,
	Dong Aisheng, Fabio Estevam, Shawn Guo, Jacky Bai,
	Pengutronix Kernel Team, Sascha Hauer, NXP Linux Team, Sean Wang,
	Jonathan Neuschäfer, Paul Cercueil, Lakshmi Sowjanya D,
	Bjorn Andersson, Andy Gross, Konrad Dybcio, Emil Renner Berthing,
	Hal Feng

The group is not used anywhere, remove it. And if needed, it should be
struct pingroup anyway.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 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


^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH v1 04/17] pinctrl: qcom: lpass-lpi: Remove unused member in struct lpi_pingroup
@ 2023-11-22 16:35   ` Andy Shevchenko
  0 siblings, 0 replies; 50+ messages in thread
From: Andy Shevchenko @ 2023-11-22 16:35 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	Rasmus Villemoes, Krzysztof Kozlowski, Uwe Kleine-König,
	Geert Uytterhoeven, Biju Das, Claudiu Beznea, Jianlong Huang,
	linux-arm-kernel, linux-gpio, linux-kernel, linux-mediatek,
	openbmc, linux-mips, linux-arm-msm, linux-renesas-soc
  Cc: Ray Jui, Scott Branden, Broadcom internal kernel review list,
	Dong Aisheng, Fabio Estevam, Shawn Guo, Jacky Bai,
	Pengutronix Kernel Team, Sascha Hauer, NXP Linux Team, Sean Wang,
	Jonathan Neuschäfer, Paul Cercueil, Lakshmi Sowjanya D,
	Bjorn Andersson, Andy Gross, Konrad Dybcio, Emil Renner Berthing,
	Hal Feng

The group is not used anywhere, remove it. And if needed, it should be
struct pingroup anyway.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 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


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH v1 05/17] pinctrl: core: Add a convenient define PINCTRL_GROUP_DESC()
  2023-11-22 16:35 ` Andy Shevchenko
@ 2023-11-22 16:35   ` Andy Shevchenko
  -1 siblings, 0 replies; 50+ messages in thread
From: Andy Shevchenko @ 2023-11-22 16:35 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	Rasmus Villemoes, Krzysztof Kozlowski, Uwe Kleine-König,
	Geert Uytterhoeven, Biju Das, Claudiu Beznea, Jianlong Huang,
	linux-arm-kernel, linux-gpio, linux-kernel, linux-mediatek,
	openbmc, linux-mips, linux-arm-msm, linux-renesas-soc
  Cc: Ray Jui, Scott Branden, Broadcom internal kernel review list,
	Dong Aisheng, Fabio Estevam, Shawn Guo, Jacky Bai,
	Pengutronix Kernel Team, Sascha Hauer, NXP Linux Team, Sean Wang,
	Jonathan Neuschäfer, Paul Cercueil, Lakshmi Sowjanya D,
	Bjorn Andersson, Andy Gross, Konrad Dybcio, Emil Renner Berthing,
	Hal Feng

Add PINCTRL_GROUP_DESC() macro for inline use.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 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 f2977eb65522..c0354ea0597a 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 530370443c19..179948e44016 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


^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH v1 05/17] pinctrl: core: Add a convenient define PINCTRL_GROUP_DESC()
@ 2023-11-22 16:35   ` Andy Shevchenko
  0 siblings, 0 replies; 50+ messages in thread
From: Andy Shevchenko @ 2023-11-22 16:35 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	Rasmus Villemoes, Krzysztof Kozlowski, Uwe Kleine-König,
	Geert Uytterhoeven, Biju Das, Claudiu Beznea, Jianlong Huang,
	linux-arm-kernel, linux-gpio, linux-kernel, linux-mediatek,
	openbmc, linux-mips, linux-arm-msm, linux-renesas-soc
  Cc: Ray Jui, Scott Branden, Broadcom internal kernel review list,
	Dong Aisheng, Fabio Estevam, Shawn Guo, Jacky Bai,
	Pengutronix Kernel Team, Sascha Hauer, NXP Linux Team, Sean Wang,
	Jonathan Neuschäfer, Paul Cercueil, Lakshmi Sowjanya D,
	Bjorn Andersson, Andy Gross, Konrad Dybcio, Emil Renner Berthing,
	Hal Feng

Add PINCTRL_GROUP_DESC() macro for inline use.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 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 f2977eb65522..c0354ea0597a 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 530370443c19..179948e44016 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


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH v1 06/17] pinctrl: ingenic: Make use of PINCTRL_GROUP_DESC()
  2023-11-22 16:35 ` Andy Shevchenko
@ 2023-11-22 16:35   ` Andy Shevchenko
  -1 siblings, 0 replies; 50+ messages in thread
From: Andy Shevchenko @ 2023-11-22 16:35 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	Rasmus Villemoes, Krzysztof Kozlowski, Uwe Kleine-König,
	Geert Uytterhoeven, Biju Das, Claudiu Beznea, Jianlong Huang,
	linux-arm-kernel, linux-gpio, linux-kernel, linux-mediatek,
	openbmc, linux-mips, linux-arm-msm, linux-renesas-soc
  Cc: Ray Jui, Scott Branden, Broadcom internal kernel review list,
	Dong Aisheng, Fabio Estevam, Shawn Guo, Jacky Bai,
	Pengutronix Kernel Team, Sascha Hauer, NXP Linux Team, Sean Wang,
	Jonathan Neuschäfer, Paul Cercueil, Lakshmi Sowjanya D,
	Bjorn Andersson, Andy Gross, Konrad Dybcio, Emil Renner Berthing,
	Hal Feng

Make use of PINCTRL_GROUP_DESC() instead of open coding it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 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


^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH v1 06/17] pinctrl: ingenic: Make use of PINCTRL_GROUP_DESC()
@ 2023-11-22 16:35   ` Andy Shevchenko
  0 siblings, 0 replies; 50+ messages in thread
From: Andy Shevchenko @ 2023-11-22 16:35 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	Rasmus Villemoes, Krzysztof Kozlowski, Uwe Kleine-König,
	Geert Uytterhoeven, Biju Das, Claudiu Beznea, Jianlong Huang,
	linux-arm-kernel, linux-gpio, linux-kernel, linux-mediatek,
	openbmc, linux-mips, linux-arm-msm, linux-renesas-soc
  Cc: Ray Jui, Scott Branden, Broadcom internal kernel review list,
	Dong Aisheng, Fabio Estevam, Shawn Guo, Jacky Bai,
	Pengutronix Kernel Team, Sascha Hauer, NXP Linux Team, Sean Wang,
	Jonathan Neuschäfer, Paul Cercueil, Lakshmi Sowjanya D,
	Bjorn Andersson, Andy Gross, Konrad Dybcio, Emil Renner Berthing,
	Hal Feng

Make use of PINCTRL_GROUP_DESC() instead of open coding it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 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


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH v1 07/17] pinctrl: mediatek: Make use of PINCTRL_GROUP_DESC()
  2023-11-22 16:35 ` Andy Shevchenko
@ 2023-11-22 16:35   ` Andy Shevchenko
  -1 siblings, 0 replies; 50+ messages in thread
From: Andy Shevchenko @ 2023-11-22 16:35 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	Rasmus Villemoes, Krzysztof Kozlowski, Uwe Kleine-König,
	Geert Uytterhoeven, Biju Das, Claudiu Beznea, Jianlong Huang,
	linux-arm-kernel, linux-gpio, linux-kernel, linux-mediatek,
	openbmc, linux-mips, linux-arm-msm, linux-renesas-soc
  Cc: Ray Jui, Scott Branden, Broadcom internal kernel review list,
	Dong Aisheng, Fabio Estevam, Shawn Guo, Jacky Bai,
	Pengutronix Kernel Team, Sascha Hauer, NXP Linux Team, Sean Wang,
	Jonathan Neuschäfer, Paul Cercueil, Lakshmi Sowjanya D,
	Bjorn Andersson, Andy Gross, Konrad Dybcio, Emil Renner Berthing,
	Hal Feng

Make use of PINCTRL_GROUP_DESC() instead of open coding it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 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


^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH v1 07/17] pinctrl: mediatek: Make use of PINCTRL_GROUP_DESC()
@ 2023-11-22 16:35   ` Andy Shevchenko
  0 siblings, 0 replies; 50+ messages in thread
From: Andy Shevchenko @ 2023-11-22 16:35 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	Rasmus Villemoes, Krzysztof Kozlowski, Uwe Kleine-König,
	Geert Uytterhoeven, Biju Das, Claudiu Beznea, Jianlong Huang,
	linux-arm-kernel, linux-gpio, linux-kernel, linux-mediatek,
	openbmc, linux-mips, linux-arm-msm, linux-renesas-soc
  Cc: Ray Jui, Scott Branden, Broadcom internal kernel review list,
	Dong Aisheng, Fabio Estevam, Shawn Guo, Jacky Bai,
	Pengutronix Kernel Team, Sascha Hauer, NXP Linux Team, Sean Wang,
	Jonathan Neuschäfer, Paul Cercueil, Lakshmi Sowjanya D,
	Bjorn Andersson, Andy Gross, Konrad Dybcio, Emil Renner Berthing,
	Hal Feng

Make use of PINCTRL_GROUP_DESC() instead of open coding it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 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


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH v1 08/17] pinctrl: core: Embed struct pingroup into struct group_desc
  2023-11-22 16:35 ` Andy Shevchenko
@ 2023-11-22 16:35   ` Andy Shevchenko
  -1 siblings, 0 replies; 50+ messages in thread
From: Andy Shevchenko @ 2023-11-22 16:35 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	Rasmus Villemoes, Krzysztof Kozlowski, Uwe Kleine-König,
	Geert Uytterhoeven, Biju Das, Claudiu Beznea, Jianlong Huang,
	linux-arm-kernel, linux-gpio, linux-kernel, linux-mediatek,
	openbmc, linux-mips, linux-arm-msm, linux-renesas-soc
  Cc: Ray Jui, Scott Branden, Broadcom internal kernel review list,
	Dong Aisheng, Fabio Estevam, Shawn Guo, Jacky Bai,
	Pengutronix Kernel Team, Sascha Hauer, NXP Linux Team, Sean Wang,
	Jonathan Neuschäfer, Paul Cercueil, Lakshmi Sowjanya D,
	Bjorn Andersson, Andy Gross, Konrad Dybcio, Emil Renner Berthing,
	Hal Feng

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 <andriy.shevchenko@linux.intel.com>
---
 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 c0354ea0597a..981e2e375a39 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 179948e44016..7a21af2b437e 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;
 	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


^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH v1 08/17] pinctrl: core: Embed struct pingroup into struct group_desc
@ 2023-11-22 16:35   ` Andy Shevchenko
  0 siblings, 0 replies; 50+ messages in thread
From: Andy Shevchenko @ 2023-11-22 16:35 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	Rasmus Villemoes, Krzysztof Kozlowski, Uwe Kleine-König,
	Geert Uytterhoeven, Biju Das, Claudiu Beznea, Jianlong Huang,
	linux-arm-kernel, linux-gpio, linux-kernel, linux-mediatek,
	openbmc, linux-mips, linux-arm-msm, linux-renesas-soc
  Cc: Ray Jui, Scott Branden, Broadcom internal kernel review list,
	Dong Aisheng, Fabio Estevam, Shawn Guo, Jacky Bai,
	Pengutronix Kernel Team, Sascha Hauer, NXP Linux Team, Sean Wang,
	Jonathan Neuschäfer, Paul Cercueil, Lakshmi Sowjanya D,
	Bjorn Andersson, Andy Gross, Konrad Dybcio, Emil Renner Berthing,
	Hal Feng

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 <andriy.shevchenko@linux.intel.com>
---
 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 c0354ea0597a..981e2e375a39 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 179948e44016..7a21af2b437e 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;
 	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


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH v1 09/17] pinctrl: bcm: Convert to use grp member
  2023-11-22 16:35 ` Andy Shevchenko
@ 2023-11-22 16:35   ` Andy Shevchenko
  -1 siblings, 0 replies; 50+ messages in thread
From: Andy Shevchenko @ 2023-11-22 16:35 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	Rasmus Villemoes, Krzysztof Kozlowski, Uwe Kleine-König,
	Geert Uytterhoeven, Biju Das, Claudiu Beznea, Jianlong Huang,
	linux-arm-kernel, linux-gpio, linux-kernel, linux-mediatek,
	openbmc, linux-mips, linux-arm-msm, linux-renesas-soc
  Cc: Ray Jui, Scott Branden, Broadcom internal kernel review list,
	Dong Aisheng, Fabio Estevam, Shawn Guo, Jacky Bai,
	Pengutronix Kernel Team, Sascha Hauer, NXP Linux Team, Sean Wang,
	Jonathan Neuschäfer, Paul Cercueil, Lakshmi Sowjanya D,
	Bjorn Andersson, Andy Gross, Konrad Dybcio, Emil Renner Berthing,
	Hal Feng

Convert drivers to use grp member embedded in struct group_desc.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 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


^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH v1 09/17] pinctrl: bcm: Convert to use grp member
@ 2023-11-22 16:35   ` Andy Shevchenko
  0 siblings, 0 replies; 50+ messages in thread
From: Andy Shevchenko @ 2023-11-22 16:35 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	Rasmus Villemoes, Krzysztof Kozlowski, Uwe Kleine-König,
	Geert Uytterhoeven, Biju Das, Claudiu Beznea, Jianlong Huang,
	linux-arm-kernel, linux-gpio, linux-kernel, linux-mediatek,
	openbmc, linux-mips, linux-arm-msm, linux-renesas-soc
  Cc: Ray Jui, Scott Branden, Broadcom internal kernel review list,
	Dong Aisheng, Fabio Estevam, Shawn Guo, Jacky Bai,
	Pengutronix Kernel Team, Sascha Hauer, NXP Linux Team, Sean Wang,
	Jonathan Neuschäfer, Paul Cercueil, Lakshmi Sowjanya D,
	Bjorn Andersson, Andy Gross, Konrad Dybcio, Emil Renner Berthing,
	Hal Feng

Convert drivers to use grp member embedded in struct group_desc.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 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


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH v1 10/17] pinctrl: equilibrium: Convert to use grp member
  2023-11-22 16:35 ` Andy Shevchenko
@ 2023-11-22 16:35   ` Andy Shevchenko
  -1 siblings, 0 replies; 50+ messages in thread
From: Andy Shevchenko @ 2023-11-22 16:35 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	Rasmus Villemoes, Krzysztof Kozlowski, Uwe Kleine-König,
	Geert Uytterhoeven, Biju Das, Claudiu Beznea, Jianlong Huang,
	linux-arm-kernel, linux-gpio, linux-kernel, linux-mediatek,
	openbmc, linux-mips, linux-arm-msm, linux-renesas-soc
  Cc: Ray Jui, Scott Branden, Broadcom internal kernel review list,
	Dong Aisheng, Fabio Estevam, Shawn Guo, Jacky Bai,
	Pengutronix Kernel Team, Sascha Hauer, NXP Linux Team, Sean Wang,
	Jonathan Neuschäfer, Paul Cercueil, Lakshmi Sowjanya D,
	Bjorn Andersson, Andy Gross, Konrad Dybcio, Emil Renner Berthing,
	Hal Feng

Convert drivers to use grp member embedded in struct group_desc.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 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 9202a60b4ec7..3e27b23d859c 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


^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH v1 10/17] pinctrl: equilibrium: Convert to use grp member
@ 2023-11-22 16:35   ` Andy Shevchenko
  0 siblings, 0 replies; 50+ messages in thread
From: Andy Shevchenko @ 2023-11-22 16:35 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	Rasmus Villemoes, Krzysztof Kozlowski, Uwe Kleine-König,
	Geert Uytterhoeven, Biju Das, Claudiu Beznea, Jianlong Huang,
	linux-arm-kernel, linux-gpio, linux-kernel, linux-mediatek,
	openbmc, linux-mips, linux-arm-msm, linux-renesas-soc
  Cc: Ray Jui, Scott Branden, Broadcom internal kernel review list,
	Dong Aisheng, Fabio Estevam, Shawn Guo, Jacky Bai,
	Pengutronix Kernel Team, Sascha Hauer, NXP Linux Team, Sean Wang,
	Jonathan Neuschäfer, Paul Cercueil, Lakshmi Sowjanya D,
	Bjorn Andersson, Andy Gross, Konrad Dybcio, Emil Renner Berthing,
	Hal Feng

Convert drivers to use grp member embedded in struct group_desc.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 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 9202a60b4ec7..3e27b23d859c 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


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH v1 11/17] pinctrl: imx: Convert to use grp member
  2023-11-22 16:35 ` Andy Shevchenko
@ 2023-11-22 16:35   ` Andy Shevchenko
  -1 siblings, 0 replies; 50+ messages in thread
From: Andy Shevchenko @ 2023-11-22 16:35 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	Rasmus Villemoes, Krzysztof Kozlowski, Uwe Kleine-König,
	Geert Uytterhoeven, Biju Das, Claudiu Beznea, Jianlong Huang,
	linux-arm-kernel, linux-gpio, linux-kernel, linux-mediatek,
	openbmc, linux-mips, linux-arm-msm, linux-renesas-soc
  Cc: Ray Jui, Scott Branden, Broadcom internal kernel review list,
	Dong Aisheng, Fabio Estevam, Shawn Guo, Jacky Bai,
	Pengutronix Kernel Team, Sascha Hauer, NXP Linux Team, Sean Wang,
	Jonathan Neuschäfer, Paul Cercueil, Lakshmi Sowjanya D,
	Bjorn Andersson, Andy Gross, Konrad Dybcio, Emil Renner Berthing,
	Hal Feng

Convert drivers to use grp member embedded in struct group_desc.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/pinctrl/freescale/pinctrl-imx.c | 44 ++++++++++++-------------
 1 file changed, 21 insertions(+), 23 deletions(-)

diff --git a/drivers/pinctrl/freescale/pinctrl-imx.c b/drivers/pinctrl/freescale/pinctrl-imx.c
index 9bc16943014f..680faa00b623 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);
@@ -510,6 +510,7 @@ static int imx_pinctrl_parse_groups(struct device_node *np,
 				    u32 index)
 {
 	const struct imx_pinctrl_soc_info *info = ipctl->info;
+	struct pingroup *pgrp = &grp->grp;
 	struct imx_pin *pin;
 	int size, pin_size;
 	const __be32 *list;
@@ -524,9 +525,6 @@ static int imx_pinctrl_parse_groups(struct device_node *np,
 	else
 		pin_size = FSL_PIN_SIZE;
 
-	/* Initialise group */
-	grp->name = np->name;
-
 	/*
 	 * the binding format is fsl,pins = <PIN_FUNC_ID CONFIG ...>,
 	 * do sanity check and calculate pins number
@@ -553,23 +551,24 @@ 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->pins = devm_kcalloc(ipctl->dev,
-				 grp->num_pins, sizeof(unsigned int),
-				 GFP_KERNEL);
-	if (!grp->pins || !grp->data)
+	/* Initialise group */
+	pgrp->npins = size / pin_size;
+	pgrp->pins = devm_kcalloc(ipctl->dev, pgrp->npins, sizeof(*pgrp->pins), GFP_KERNEL);
+	if (!pgrp->pins)
+		return -ENOMEM;
+	pgrp->name = np->name;
+
+	grp->data = devm_kcalloc(ipctl->dev, pgrp->npins, sizeof(*pin), GFP_KERNEL);
+	if (!grp->data)
 		return -ENOMEM;
 
-	for (i = 0; i < grp->num_pins; i++) {
+	for (i = 0; i < pgrp->npins; i++) {
 		pin = &((struct imx_pin *)(grp->data))[i];
 		if (info->flags & IMX_USE_SCU)
-			info->imx_pinctrl_parse_pin(ipctl, &grp->pins[i],
+			info->imx_pinctrl_parse_pin(ipctl, &pgrp->pins[i],
 						  pin, &list);
 		else
-			imx_pinctrl_parse_pin_mmio(ipctl, &grp->pins[i],
+			imx_pinctrl_parse_pin_mmio(ipctl, &pgrp->pins[i],
 						   pin, &list, np);
 	}
 
@@ -612,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


^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH v1 11/17] pinctrl: imx: Convert to use grp member
@ 2023-11-22 16:35   ` Andy Shevchenko
  0 siblings, 0 replies; 50+ messages in thread
From: Andy Shevchenko @ 2023-11-22 16:35 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	Rasmus Villemoes, Krzysztof Kozlowski, Uwe Kleine-König,
	Geert Uytterhoeven, Biju Das, Claudiu Beznea, Jianlong Huang,
	linux-arm-kernel, linux-gpio, linux-kernel, linux-mediatek,
	openbmc, linux-mips, linux-arm-msm, linux-renesas-soc
  Cc: Ray Jui, Scott Branden, Broadcom internal kernel review list,
	Dong Aisheng, Fabio Estevam, Shawn Guo, Jacky Bai,
	Pengutronix Kernel Team, Sascha Hauer, NXP Linux Team, Sean Wang,
	Jonathan Neuschäfer, Paul Cercueil, Lakshmi Sowjanya D,
	Bjorn Andersson, Andy Gross, Konrad Dybcio, Emil Renner Berthing,
	Hal Feng

Convert drivers to use grp member embedded in struct group_desc.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/pinctrl/freescale/pinctrl-imx.c | 44 ++++++++++++-------------
 1 file changed, 21 insertions(+), 23 deletions(-)

diff --git a/drivers/pinctrl/freescale/pinctrl-imx.c b/drivers/pinctrl/freescale/pinctrl-imx.c
index 9bc16943014f..680faa00b623 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);
@@ -510,6 +510,7 @@ static int imx_pinctrl_parse_groups(struct device_node *np,
 				    u32 index)
 {
 	const struct imx_pinctrl_soc_info *info = ipctl->info;
+	struct pingroup *pgrp = &grp->grp;
 	struct imx_pin *pin;
 	int size, pin_size;
 	const __be32 *list;
@@ -524,9 +525,6 @@ static int imx_pinctrl_parse_groups(struct device_node *np,
 	else
 		pin_size = FSL_PIN_SIZE;
 
-	/* Initialise group */
-	grp->name = np->name;
-
 	/*
 	 * the binding format is fsl,pins = <PIN_FUNC_ID CONFIG ...>,
 	 * do sanity check and calculate pins number
@@ -553,23 +551,24 @@ 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->pins = devm_kcalloc(ipctl->dev,
-				 grp->num_pins, sizeof(unsigned int),
-				 GFP_KERNEL);
-	if (!grp->pins || !grp->data)
+	/* Initialise group */
+	pgrp->npins = size / pin_size;
+	pgrp->pins = devm_kcalloc(ipctl->dev, pgrp->npins, sizeof(*pgrp->pins), GFP_KERNEL);
+	if (!pgrp->pins)
+		return -ENOMEM;
+	pgrp->name = np->name;
+
+	grp->data = devm_kcalloc(ipctl->dev, pgrp->npins, sizeof(*pin), GFP_KERNEL);
+	if (!grp->data)
 		return -ENOMEM;
 
-	for (i = 0; i < grp->num_pins; i++) {
+	for (i = 0; i < pgrp->npins; i++) {
 		pin = &((struct imx_pin *)(grp->data))[i];
 		if (info->flags & IMX_USE_SCU)
-			info->imx_pinctrl_parse_pin(ipctl, &grp->pins[i],
+			info->imx_pinctrl_parse_pin(ipctl, &pgrp->pins[i],
 						  pin, &list);
 		else
-			imx_pinctrl_parse_pin_mmio(ipctl, &grp->pins[i],
+			imx_pinctrl_parse_pin_mmio(ipctl, &pgrp->pins[i],
 						   pin, &list, np);
 	}
 
@@ -612,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


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH v1 12/17] pinctrl: ingenic: Convert to use grp member
  2023-11-22 16:35 ` Andy Shevchenko
@ 2023-11-22 16:35   ` Andy Shevchenko
  -1 siblings, 0 replies; 50+ messages in thread
From: Andy Shevchenko @ 2023-11-22 16:35 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	Rasmus Villemoes, Krzysztof Kozlowski, Uwe Kleine-König,
	Geert Uytterhoeven, Biju Das, Claudiu Beznea, Jianlong Huang,
	linux-arm-kernel, linux-gpio, linux-kernel, linux-mediatek,
	openbmc, linux-mips, linux-arm-msm, linux-renesas-soc
  Cc: Ray Jui, Scott Branden, Broadcom internal kernel review list,
	Dong Aisheng, Fabio Estevam, Shawn Guo, Jacky Bai,
	Pengutronix Kernel Team, Sascha Hauer, NXP Linux Team, Sean Wang,
	Jonathan Neuschäfer, Paul Cercueil, Lakshmi Sowjanya D,
	Bjorn Andersson, Andy Gross, Konrad Dybcio, Emil Renner Berthing,
	Hal Feng

Convert drivers to use grp member embedded in struct group_desc.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 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


^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH v1 12/17] pinctrl: ingenic: Convert to use grp member
@ 2023-11-22 16:35   ` Andy Shevchenko
  0 siblings, 0 replies; 50+ messages in thread
From: Andy Shevchenko @ 2023-11-22 16:35 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	Rasmus Villemoes, Krzysztof Kozlowski, Uwe Kleine-König,
	Geert Uytterhoeven, Biju Das, Claudiu Beznea, Jianlong Huang,
	linux-arm-kernel, linux-gpio, linux-kernel, linux-mediatek,
	openbmc, linux-mips, linux-arm-msm, linux-renesas-soc
  Cc: Ray Jui, Scott Branden, Broadcom internal kernel review list,
	Dong Aisheng, Fabio Estevam, Shawn Guo, Jacky Bai,
	Pengutronix Kernel Team, Sascha Hauer, NXP Linux Team, Sean Wang,
	Jonathan Neuschäfer, Paul Cercueil, Lakshmi Sowjanya D,
	Bjorn Andersson, Andy Gross, Konrad Dybcio, Emil Renner Berthing,
	Hal Feng

Convert drivers to use grp member embedded in struct group_desc.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 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


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH v1 13/17] pinctrl: keembay: Convert to use grp member
  2023-11-22 16:35 ` Andy Shevchenko
@ 2023-11-22 16:35   ` Andy Shevchenko
  -1 siblings, 0 replies; 50+ messages in thread
From: Andy Shevchenko @ 2023-11-22 16:35 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	Rasmus Villemoes, Krzysztof Kozlowski, Uwe Kleine-König,
	Geert Uytterhoeven, Biju Das, Claudiu Beznea, Jianlong Huang,
	linux-arm-kernel, linux-gpio, linux-kernel, linux-mediatek,
	openbmc, linux-mips, linux-arm-msm, linux-renesas-soc
  Cc: Ray Jui, Scott Branden, Broadcom internal kernel review list,
	Dong Aisheng, Fabio Estevam, Shawn Guo, Jacky Bai,
	Pengutronix Kernel Team, Sascha Hauer, NXP Linux Team, Sean Wang,
	Jonathan Neuschäfer, Paul Cercueil, Lakshmi Sowjanya D,
	Bjorn Andersson, Andy Gross, Konrad Dybcio, Emil Renner Berthing,
	Hal Feng

Convert drivers to use grp member embedded in struct group_desc.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/pinctrl/pinctrl-keembay.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-keembay.c b/drivers/pinctrl/pinctrl-keembay.c
index 152c35bce8ec..ace61f8e8936 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);
@@ -1528,12 +1528,11 @@ 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 *pgrp = &grp[i].grp;
 
-		kmb_grp->name = pdesc->name;
-		kmb_grp->pins = (int *)&pdesc->number;
-		pinctrl_generic_add_group(kpc->pctrl, kmb_grp->name,
-					  kmb_grp->pins, 1, NULL);
+		pgrp->name = pdesc->name;
+		pgrp->pins = (int *)&pdesc->number;
+		pinctrl_generic_add_group(kpc->pctrl, pgrp->name, pgrp->pins, 1, NULL);
 	}
 
 	return 0;
-- 
2.43.0.rc1.1.gbec44491f096


^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH v1 13/17] pinctrl: keembay: Convert to use grp member
@ 2023-11-22 16:35   ` Andy Shevchenko
  0 siblings, 0 replies; 50+ messages in thread
From: Andy Shevchenko @ 2023-11-22 16:35 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	Rasmus Villemoes, Krzysztof Kozlowski, Uwe Kleine-König,
	Geert Uytterhoeven, Biju Das, Claudiu Beznea, Jianlong Huang,
	linux-arm-kernel, linux-gpio, linux-kernel, linux-mediatek,
	openbmc, linux-mips, linux-arm-msm, linux-renesas-soc
  Cc: Ray Jui, Scott Branden, Broadcom internal kernel review list,
	Dong Aisheng, Fabio Estevam, Shawn Guo, Jacky Bai,
	Pengutronix Kernel Team, Sascha Hauer, NXP Linux Team, Sean Wang,
	Jonathan Neuschäfer, Paul Cercueil, Lakshmi Sowjanya D,
	Bjorn Andersson, Andy Gross, Konrad Dybcio, Emil Renner Berthing,
	Hal Feng

Convert drivers to use grp member embedded in struct group_desc.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/pinctrl/pinctrl-keembay.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-keembay.c b/drivers/pinctrl/pinctrl-keembay.c
index 152c35bce8ec..ace61f8e8936 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);
@@ -1528,12 +1528,11 @@ 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 *pgrp = &grp[i].grp;
 
-		kmb_grp->name = pdesc->name;
-		kmb_grp->pins = (int *)&pdesc->number;
-		pinctrl_generic_add_group(kpc->pctrl, kmb_grp->name,
-					  kmb_grp->pins, 1, NULL);
+		pgrp->name = pdesc->name;
+		pgrp->pins = (int *)&pdesc->number;
+		pinctrl_generic_add_group(kpc->pctrl, pgrp->name, pgrp->pins, 1, NULL);
 	}
 
 	return 0;
-- 
2.43.0.rc1.1.gbec44491f096


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH v1 14/17] pinctrl: mediatek: Convert to use grp member
  2023-11-22 16:35 ` Andy Shevchenko
@ 2023-11-22 16:35   ` Andy Shevchenko
  -1 siblings, 0 replies; 50+ messages in thread
From: Andy Shevchenko @ 2023-11-22 16:35 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	Rasmus Villemoes, Krzysztof Kozlowski, Uwe Kleine-König,
	Geert Uytterhoeven, Biju Das, Claudiu Beznea, Jianlong Huang,
	linux-arm-kernel, linux-gpio, linux-kernel, linux-mediatek,
	openbmc, linux-mips, linux-arm-msm, linux-renesas-soc
  Cc: Ray Jui, Scott Branden, Broadcom internal kernel review list,
	Dong Aisheng, Fabio Estevam, Shawn Guo, Jacky Bai,
	Pengutronix Kernel Team, Sascha Hauer, NXP Linux Team, Sean Wang,
	Jonathan Neuschäfer, Paul Cercueil, Lakshmi Sowjanya D,
	Bjorn Andersson, Andy Gross, Konrad Dybcio, Emil Renner Berthing,
	Hal Feng

Convert drivers to use grp member embedded in struct group_desc.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 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


^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH v1 14/17] pinctrl: mediatek: Convert to use grp member
@ 2023-11-22 16:35   ` Andy Shevchenko
  0 siblings, 0 replies; 50+ messages in thread
From: Andy Shevchenko @ 2023-11-22 16:35 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	Rasmus Villemoes, Krzysztof Kozlowski, Uwe Kleine-König,
	Geert Uytterhoeven, Biju Das, Claudiu Beznea, Jianlong Huang,
	linux-arm-kernel, linux-gpio, linux-kernel, linux-mediatek,
	openbmc, linux-mips, linux-arm-msm, linux-renesas-soc
  Cc: Ray Jui, Scott Branden, Broadcom internal kernel review list,
	Dong Aisheng, Fabio Estevam, Shawn Guo, Jacky Bai,
	Pengutronix Kernel Team, Sascha Hauer, NXP Linux Team, Sean Wang,
	Jonathan Neuschäfer, Paul Cercueil, Lakshmi Sowjanya D,
	Bjorn Andersson, Andy Gross, Konrad Dybcio, Emil Renner Berthing,
	Hal Feng

Convert drivers to use grp member embedded in struct group_desc.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 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


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH v1 15/17] pinctrl: renesas: Convert to use grp member
  2023-11-22 16:35 ` Andy Shevchenko
@ 2023-11-22 16:35   ` Andy Shevchenko
  -1 siblings, 0 replies; 50+ messages in thread
From: Andy Shevchenko @ 2023-11-22 16:35 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	Rasmus Villemoes, Krzysztof Kozlowski, Uwe Kleine-König,
	Geert Uytterhoeven, Biju Das, Claudiu Beznea, Jianlong Huang,
	linux-arm-kernel, linux-gpio, linux-kernel, linux-mediatek,
	openbmc, linux-mips, linux-arm-msm, linux-renesas-soc
  Cc: Ray Jui, Scott Branden, Broadcom internal kernel review list,
	Dong Aisheng, Fabio Estevam, Shawn Guo, Jacky Bai,
	Pengutronix Kernel Team, Sascha Hauer, NXP Linux Team, Sean Wang,
	Jonathan Neuschäfer, Paul Cercueil, Lakshmi Sowjanya D,
	Bjorn Andersson, Andy Gross, Konrad Dybcio, Emil Renner Berthing,
	Hal Feng

Convert drivers to use grp member embedded in struct group_desc.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/pinctrl/renesas/pinctrl-rza1.c  |  2 +-
 drivers/pinctrl/renesas/pinctrl-rza2.c  | 10 +++++-----
 drivers/pinctrl/renesas/pinctrl-rzg2l.c |  4 ++--
 drivers/pinctrl/renesas/pinctrl-rzv2m.c |  4 ++--
 4 files changed, 10 insertions(+), 10 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..511247e70371 100644
--- a/drivers/pinctrl/renesas/pinctrl-rzg2l.c
+++ b/drivers/pinctrl/renesas/pinctrl-rzg2l.c
@@ -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..62f3924f5bea 100644
--- a/drivers/pinctrl/renesas/pinctrl-rzv2m.c
+++ b/drivers/pinctrl/renesas/pinctrl-rzv2m.c
@@ -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


^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH v1 15/17] pinctrl: renesas: Convert to use grp member
@ 2023-11-22 16:35   ` Andy Shevchenko
  0 siblings, 0 replies; 50+ messages in thread
From: Andy Shevchenko @ 2023-11-22 16:35 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	Rasmus Villemoes, Krzysztof Kozlowski, Uwe Kleine-König,
	Geert Uytterhoeven, Biju Das, Claudiu Beznea, Jianlong Huang,
	linux-arm-kernel, linux-gpio, linux-kernel, linux-mediatek,
	openbmc, linux-mips, linux-arm-msm, linux-renesas-soc
  Cc: Ray Jui, Scott Branden, Broadcom internal kernel review list,
	Dong Aisheng, Fabio Estevam, Shawn Guo, Jacky Bai,
	Pengutronix Kernel Team, Sascha Hauer, NXP Linux Team, Sean Wang,
	Jonathan Neuschäfer, Paul Cercueil, Lakshmi Sowjanya D,
	Bjorn Andersson, Andy Gross, Konrad Dybcio, Emil Renner Berthing,
	Hal Feng

Convert drivers to use grp member embedded in struct group_desc.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/pinctrl/renesas/pinctrl-rza1.c  |  2 +-
 drivers/pinctrl/renesas/pinctrl-rza2.c  | 10 +++++-----
 drivers/pinctrl/renesas/pinctrl-rzg2l.c |  4 ++--
 drivers/pinctrl/renesas/pinctrl-rzv2m.c |  4 ++--
 4 files changed, 10 insertions(+), 10 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..511247e70371 100644
--- a/drivers/pinctrl/renesas/pinctrl-rzg2l.c
+++ b/drivers/pinctrl/renesas/pinctrl-rzg2l.c
@@ -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..62f3924f5bea 100644
--- a/drivers/pinctrl/renesas/pinctrl-rzv2m.c
+++ b/drivers/pinctrl/renesas/pinctrl-rzv2m.c
@@ -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


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH v1 16/17] pinctrl: starfive: Convert to use grp member
  2023-11-22 16:35 ` Andy Shevchenko
@ 2023-11-22 16:35   ` Andy Shevchenko
  -1 siblings, 0 replies; 50+ messages in thread
From: Andy Shevchenko @ 2023-11-22 16:35 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	Rasmus Villemoes, Krzysztof Kozlowski, Uwe Kleine-König,
	Geert Uytterhoeven, Biju Das, Claudiu Beznea, Jianlong Huang,
	linux-arm-kernel, linux-gpio, linux-kernel, linux-mediatek,
	openbmc, linux-mips, linux-arm-msm, linux-renesas-soc
  Cc: Ray Jui, Scott Branden, Broadcom internal kernel review list,
	Dong Aisheng, Fabio Estevam, Shawn Guo, Jacky Bai,
	Pengutronix Kernel Team, Sascha Hauer, NXP Linux Team, Sean Wang,
	Jonathan Neuschäfer, Paul Cercueil, Lakshmi Sowjanya D,
	Bjorn Andersson, Andy Gross, Konrad Dybcio, Emil Renner Berthing,
	Hal Feng

Convert drivers to use grp member embedded in struct group_desc.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 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


^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH v1 16/17] pinctrl: starfive: Convert to use grp member
@ 2023-11-22 16:35   ` Andy Shevchenko
  0 siblings, 0 replies; 50+ messages in thread
From: Andy Shevchenko @ 2023-11-22 16:35 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	Rasmus Villemoes, Krzysztof Kozlowski, Uwe Kleine-König,
	Geert Uytterhoeven, Biju Das, Claudiu Beznea, Jianlong Huang,
	linux-arm-kernel, linux-gpio, linux-kernel, linux-mediatek,
	openbmc, linux-mips, linux-arm-msm, linux-renesas-soc
  Cc: Ray Jui, Scott Branden, Broadcom internal kernel review list,
	Dong Aisheng, Fabio Estevam, Shawn Guo, Jacky Bai,
	Pengutronix Kernel Team, Sascha Hauer, NXP Linux Team, Sean Wang,
	Jonathan Neuschäfer, Paul Cercueil, Lakshmi Sowjanya D,
	Bjorn Andersson, Andy Gross, Konrad Dybcio, Emil Renner Berthing,
	Hal Feng

Convert drivers to use grp member embedded in struct group_desc.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 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


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH v1 17/17] pinctrl: core: Remove unused members from struct group_desc
  2023-11-22 16:35 ` Andy Shevchenko
@ 2023-11-22 16:35   ` Andy Shevchenko
  -1 siblings, 0 replies; 50+ messages in thread
From: Andy Shevchenko @ 2023-11-22 16:35 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	Rasmus Villemoes, Krzysztof Kozlowski, Uwe Kleine-König,
	Geert Uytterhoeven, Biju Das, Claudiu Beznea, Jianlong Huang,
	linux-arm-kernel, linux-gpio, linux-kernel, linux-mediatek,
	openbmc, linux-mips, linux-arm-msm, linux-renesas-soc
  Cc: Ray Jui, Scott Branden, Broadcom internal kernel review list,
	Dong Aisheng, Fabio Estevam, Shawn Guo, Jacky Bai,
	Pengutronix Kernel Team, Sascha Hauer, NXP Linux Team, Sean Wang,
	Jonathan Neuschäfer, Paul Cercueil, Lakshmi Sowjanya D,
	Bjorn Andersson, Andy Gross, Konrad Dybcio, Emil Renner Berthing,
	Hal Feng

All drivers are converted to use embedded struct pingroup.
Remove unused members from struct group_desc.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 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 981e2e375a39..d3458284b9de 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 7a21af2b437e..7af74bfaff0e 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;
-	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


^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH v1 17/17] pinctrl: core: Remove unused members from struct group_desc
@ 2023-11-22 16:35   ` Andy Shevchenko
  0 siblings, 0 replies; 50+ messages in thread
From: Andy Shevchenko @ 2023-11-22 16:35 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko,
	Rasmus Villemoes, Krzysztof Kozlowski, Uwe Kleine-König,
	Geert Uytterhoeven, Biju Das, Claudiu Beznea, Jianlong Huang,
	linux-arm-kernel, linux-gpio, linux-kernel, linux-mediatek,
	openbmc, linux-mips, linux-arm-msm, linux-renesas-soc
  Cc: Ray Jui, Scott Branden, Broadcom internal kernel review list,
	Dong Aisheng, Fabio Estevam, Shawn Guo, Jacky Bai,
	Pengutronix Kernel Team, Sascha Hauer, NXP Linux Team, Sean Wang,
	Jonathan Neuschäfer, Paul Cercueil, Lakshmi Sowjanya D,
	Bjorn Andersson, Andy Gross, Konrad Dybcio, Emil Renner Berthing,
	Hal Feng

All drivers are converted to use embedded struct pingroup.
Remove unused members from struct group_desc.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 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 981e2e375a39..d3458284b9de 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 7a21af2b437e..7af74bfaff0e 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;
-	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


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* Re: [PATCH v1 08/17] pinctrl: core: Embed struct pingroup into struct group_desc
  2023-11-22 16:35   ` Andy Shevchenko
@ 2023-11-23  3:11     ` kernel test robot
  -1 siblings, 0 replies; 50+ messages in thread
From: kernel test robot @ 2023-11-23  3:11 UTC (permalink / raw)
  To: Andy Shevchenko, Linus Walleij, Bartosz Golaszewski,
	Rasmus Villemoes, Krzysztof Kozlowski, Uwe Kleine-König,
	Geert Uytterhoeven, Biju Das, Claudiu Beznea, Jianlong Huang,
	linux-arm-kernel, linux-gpio, linux-kernel, linux-mediatek,
	openbmc, linux-mips, linux-arm-msm, linux-renesas-soc
  Cc: oe-kbuild-all, Ray Jui, Scott Branden,
	Broadcom internal kernel review list, Dong Aisheng,
	Fabio Estevam, Shawn Guo, Jacky Bai, Pengutronix Kernel Team,
	Sascha Hauer, NXP Linux Team, Sean Wang,
	Jonathan Neuschäfer

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-20231122]
[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-equilibrium-Convert-to-use-struct-pingroup/20231123-005932
base:   https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git devel
patch link:    https://lore.kernel.org/r/20231122164040.2262742-9-andriy.shevchenko%40linux.intel.com
patch subject: [PATCH v1 08/17] pinctrl: core: Embed struct pingroup into struct group_desc
config: i386-buildonly-randconfig-004-20231123 (https://download.01.org/0day-ci/archive/20231123/202311230849.YPJuLoNP-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231123/202311230849.YPJuLoNP-lkp@intel.com/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 <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202311230849.YPJuLoNP-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from drivers/pinctrl/mediatek/pinctrl-moore.h:21,
                    from drivers/pinctrl/mediatek/pinctrl-mt7981.c:9:
>> drivers/pinctrl/mediatek/../core.h:217:21: error: initializer element is not constant
     217 | (struct group_desc) {                                           \
         |                     ^
   drivers/pinctrl/mediatek/pinctrl-moore.h:41:9: note: in expansion of macro 'PINCTRL_GROUP_DESC'
      41 |         PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), id##_funcs)
         |         ^~~~~~~~~~~~~~~~~~
   drivers/pinctrl/mediatek/pinctrl-mt7981.c:795:9: note: in expansion of macro 'PINCTRL_PIN_GROUP'
     795 |         PINCTRL_PIN_GROUP("wa_aice1", mt7981_wa_aice1),
         |         ^~~~~~~~~~~~~~~~~
   drivers/pinctrl/mediatek/../core.h:217:21: note: (near initialization for 'mt7981_groups')
     217 | (struct group_desc) {                                           \
         |                     ^
   drivers/pinctrl/mediatek/pinctrl-moore.h:41:9: note: in expansion of macro 'PINCTRL_GROUP_DESC'
      41 |         PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), id##_funcs)
         |         ^~~~~~~~~~~~~~~~~~
   drivers/pinctrl/mediatek/pinctrl-mt7981.c:795:9: note: in expansion of macro 'PINCTRL_PIN_GROUP'
     795 |         PINCTRL_PIN_GROUP("wa_aice1", mt7981_wa_aice1),
         |         ^~~~~~~~~~~~~~~~~
--
   In file included from drivers/pinctrl/mediatek/pinctrl-moore.h:21,
                    from drivers/pinctrl/mediatek/pinctrl-mt7623.c:11:
>> drivers/pinctrl/mediatek/../core.h:217:21: error: initializer element is not constant
     217 | (struct group_desc) {                                           \
         |                     ^
   drivers/pinctrl/mediatek/pinctrl-moore.h:41:9: note: in expansion of macro 'PINCTRL_GROUP_DESC'
      41 |         PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), id##_funcs)
         |         ^~~~~~~~~~~~~~~~~~
   drivers/pinctrl/mediatek/pinctrl-mt7623.c:1079:9: note: in expansion of macro 'PINCTRL_PIN_GROUP'
    1079 |         PINCTRL_PIN_GROUP("aud_ext_clk0", mt7623_aud_ext_clk0),
         |         ^~~~~~~~~~~~~~~~~
   drivers/pinctrl/mediatek/../core.h:217:21: note: (near initialization for 'mt7623_groups')
     217 | (struct group_desc) {                                           \
         |                     ^
   drivers/pinctrl/mediatek/pinctrl-moore.h:41:9: note: in expansion of macro 'PINCTRL_GROUP_DESC'
      41 |         PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), id##_funcs)
         |         ^~~~~~~~~~~~~~~~~~
   drivers/pinctrl/mediatek/pinctrl-mt7623.c:1079:9: note: in expansion of macro 'PINCTRL_PIN_GROUP'
    1079 |         PINCTRL_PIN_GROUP("aud_ext_clk0", mt7623_aud_ext_clk0),
         |         ^~~~~~~~~~~~~~~~~
--
   In file included from drivers/pinctrl/mediatek/pinctrl-moore.h:21,
                    from drivers/pinctrl/mediatek/pinctrl-mt7629.c:9:
>> drivers/pinctrl/mediatek/../core.h:217:21: error: initializer element is not constant
     217 | (struct group_desc) {                                           \
         |                     ^
   drivers/pinctrl/mediatek/pinctrl-moore.h:41:9: note: in expansion of macro 'PINCTRL_GROUP_DESC'
      41 |         PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), id##_funcs)
         |         ^~~~~~~~~~~~~~~~~~
   drivers/pinctrl/mediatek/pinctrl-mt7629.c:312:9: note: in expansion of macro 'PINCTRL_PIN_GROUP'
     312 |         PINCTRL_PIN_GROUP("ephy_leds", mt7629_ephy_leds),
         |         ^~~~~~~~~~~~~~~~~
   drivers/pinctrl/mediatek/../core.h:217:21: note: (near initialization for 'mt7629_groups')
     217 | (struct group_desc) {                                           \
         |                     ^
   drivers/pinctrl/mediatek/pinctrl-moore.h:41:9: note: in expansion of macro 'PINCTRL_GROUP_DESC'
      41 |         PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), id##_funcs)
         |         ^~~~~~~~~~~~~~~~~~
   drivers/pinctrl/mediatek/pinctrl-mt7629.c:312:9: note: in expansion of macro 'PINCTRL_PIN_GROUP'
     312 |         PINCTRL_PIN_GROUP("ephy_leds", mt7629_ephy_leds),
         |         ^~~~~~~~~~~~~~~~~


vim +217 drivers/pinctrl/mediatek/../core.h

c7059c5ac70aea1 Tony Lindgren   2016-12-27  214  
3bea9da5ae4cf43 Andy Shevchenko 2023-11-22  215  /* Convenience macro to define a generic pin group descriptor */
3bea9da5ae4cf43 Andy Shevchenko 2023-11-22  216  #define PINCTRL_GROUP_DESC(_name, _pins, _num_pins, _data)	\
3bea9da5ae4cf43 Andy Shevchenko 2023-11-22 @217  (struct group_desc) {						\
4930128932e4e5e Andy Shevchenko 2023-11-22  218  	.grp = PINCTRL_PINGROUP(_name, _pins, _num_pins),	\
3bea9da5ae4cf43 Andy Shevchenko 2023-11-22  219  	.name = _name,						\
3bea9da5ae4cf43 Andy Shevchenko 2023-11-22  220  	.pins = _pins,						\
3bea9da5ae4cf43 Andy Shevchenko 2023-11-22  221  	.num_pins = _num_pins,					\
3bea9da5ae4cf43 Andy Shevchenko 2023-11-22  222  	.data = _data,						\
3bea9da5ae4cf43 Andy Shevchenko 2023-11-22  223  }
3bea9da5ae4cf43 Andy Shevchenko 2023-11-22  224  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH v1 08/17] pinctrl: core: Embed struct pingroup into struct group_desc
@ 2023-11-23  3:11     ` kernel test robot
  0 siblings, 0 replies; 50+ messages in thread
From: kernel test robot @ 2023-11-23  3:11 UTC (permalink / raw)
  To: Andy Shevchenko, Linus Walleij, Bartosz Golaszewski,
	Rasmus Villemoes, Krzysztof Kozlowski, Uwe Kleine-König,
	Geert Uytterhoeven, Biju Das, Claudiu Beznea, Jianlong Huang,
	linux-arm-kernel, linux-gpio, linux-kernel, linux-mediatek,
	openbmc, linux-mips, linux-arm-msm, linux-renesas-soc
  Cc: oe-kbuild-all, Ray Jui, Scott Branden,
	Broadcom internal kernel review list, Dong Aisheng,
	Fabio Estevam, Shawn Guo, Jacky Bai, Pengutronix Kernel Team,
	Sascha Hauer, NXP Linux Team, Sean Wang,
	Jonathan Neuschäfer

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-20231122]
[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-equilibrium-Convert-to-use-struct-pingroup/20231123-005932
base:   https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git devel
patch link:    https://lore.kernel.org/r/20231122164040.2262742-9-andriy.shevchenko%40linux.intel.com
patch subject: [PATCH v1 08/17] pinctrl: core: Embed struct pingroup into struct group_desc
config: i386-buildonly-randconfig-004-20231123 (https://download.01.org/0day-ci/archive/20231123/202311230849.YPJuLoNP-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231123/202311230849.YPJuLoNP-lkp@intel.com/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 <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202311230849.YPJuLoNP-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from drivers/pinctrl/mediatek/pinctrl-moore.h:21,
                    from drivers/pinctrl/mediatek/pinctrl-mt7981.c:9:
>> drivers/pinctrl/mediatek/../core.h:217:21: error: initializer element is not constant
     217 | (struct group_desc) {                                           \
         |                     ^
   drivers/pinctrl/mediatek/pinctrl-moore.h:41:9: note: in expansion of macro 'PINCTRL_GROUP_DESC'
      41 |         PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), id##_funcs)
         |         ^~~~~~~~~~~~~~~~~~
   drivers/pinctrl/mediatek/pinctrl-mt7981.c:795:9: note: in expansion of macro 'PINCTRL_PIN_GROUP'
     795 |         PINCTRL_PIN_GROUP("wa_aice1", mt7981_wa_aice1),
         |         ^~~~~~~~~~~~~~~~~
   drivers/pinctrl/mediatek/../core.h:217:21: note: (near initialization for 'mt7981_groups')
     217 | (struct group_desc) {                                           \
         |                     ^
   drivers/pinctrl/mediatek/pinctrl-moore.h:41:9: note: in expansion of macro 'PINCTRL_GROUP_DESC'
      41 |         PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), id##_funcs)
         |         ^~~~~~~~~~~~~~~~~~
   drivers/pinctrl/mediatek/pinctrl-mt7981.c:795:9: note: in expansion of macro 'PINCTRL_PIN_GROUP'
     795 |         PINCTRL_PIN_GROUP("wa_aice1", mt7981_wa_aice1),
         |         ^~~~~~~~~~~~~~~~~
--
   In file included from drivers/pinctrl/mediatek/pinctrl-moore.h:21,
                    from drivers/pinctrl/mediatek/pinctrl-mt7623.c:11:
>> drivers/pinctrl/mediatek/../core.h:217:21: error: initializer element is not constant
     217 | (struct group_desc) {                                           \
         |                     ^
   drivers/pinctrl/mediatek/pinctrl-moore.h:41:9: note: in expansion of macro 'PINCTRL_GROUP_DESC'
      41 |         PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), id##_funcs)
         |         ^~~~~~~~~~~~~~~~~~
   drivers/pinctrl/mediatek/pinctrl-mt7623.c:1079:9: note: in expansion of macro 'PINCTRL_PIN_GROUP'
    1079 |         PINCTRL_PIN_GROUP("aud_ext_clk0", mt7623_aud_ext_clk0),
         |         ^~~~~~~~~~~~~~~~~
   drivers/pinctrl/mediatek/../core.h:217:21: note: (near initialization for 'mt7623_groups')
     217 | (struct group_desc) {                                           \
         |                     ^
   drivers/pinctrl/mediatek/pinctrl-moore.h:41:9: note: in expansion of macro 'PINCTRL_GROUP_DESC'
      41 |         PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), id##_funcs)
         |         ^~~~~~~~~~~~~~~~~~
   drivers/pinctrl/mediatek/pinctrl-mt7623.c:1079:9: note: in expansion of macro 'PINCTRL_PIN_GROUP'
    1079 |         PINCTRL_PIN_GROUP("aud_ext_clk0", mt7623_aud_ext_clk0),
         |         ^~~~~~~~~~~~~~~~~
--
   In file included from drivers/pinctrl/mediatek/pinctrl-moore.h:21,
                    from drivers/pinctrl/mediatek/pinctrl-mt7629.c:9:
>> drivers/pinctrl/mediatek/../core.h:217:21: error: initializer element is not constant
     217 | (struct group_desc) {                                           \
         |                     ^
   drivers/pinctrl/mediatek/pinctrl-moore.h:41:9: note: in expansion of macro 'PINCTRL_GROUP_DESC'
      41 |         PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), id##_funcs)
         |         ^~~~~~~~~~~~~~~~~~
   drivers/pinctrl/mediatek/pinctrl-mt7629.c:312:9: note: in expansion of macro 'PINCTRL_PIN_GROUP'
     312 |         PINCTRL_PIN_GROUP("ephy_leds", mt7629_ephy_leds),
         |         ^~~~~~~~~~~~~~~~~
   drivers/pinctrl/mediatek/../core.h:217:21: note: (near initialization for 'mt7629_groups')
     217 | (struct group_desc) {                                           \
         |                     ^
   drivers/pinctrl/mediatek/pinctrl-moore.h:41:9: note: in expansion of macro 'PINCTRL_GROUP_DESC'
      41 |         PINCTRL_GROUP_DESC(name, id##_pins, ARRAY_SIZE(id##_pins), id##_funcs)
         |         ^~~~~~~~~~~~~~~~~~
   drivers/pinctrl/mediatek/pinctrl-mt7629.c:312:9: note: in expansion of macro 'PINCTRL_PIN_GROUP'
     312 |         PINCTRL_PIN_GROUP("ephy_leds", mt7629_ephy_leds),
         |         ^~~~~~~~~~~~~~~~~


vim +217 drivers/pinctrl/mediatek/../core.h

c7059c5ac70aea1 Tony Lindgren   2016-12-27  214  
3bea9da5ae4cf43 Andy Shevchenko 2023-11-22  215  /* Convenience macro to define a generic pin group descriptor */
3bea9da5ae4cf43 Andy Shevchenko 2023-11-22  216  #define PINCTRL_GROUP_DESC(_name, _pins, _num_pins, _data)	\
3bea9da5ae4cf43 Andy Shevchenko 2023-11-22 @217  (struct group_desc) {						\
4930128932e4e5e Andy Shevchenko 2023-11-22  218  	.grp = PINCTRL_PINGROUP(_name, _pins, _num_pins),	\
3bea9da5ae4cf43 Andy Shevchenko 2023-11-22  219  	.name = _name,						\
3bea9da5ae4cf43 Andy Shevchenko 2023-11-22  220  	.pins = _pins,						\
3bea9da5ae4cf43 Andy Shevchenko 2023-11-22  221  	.num_pins = _num_pins,					\
3bea9da5ae4cf43 Andy Shevchenko 2023-11-22  222  	.data = _data,						\
3bea9da5ae4cf43 Andy Shevchenko 2023-11-22  223  }
3bea9da5ae4cf43 Andy Shevchenko 2023-11-22  224  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH v1 01/17] pinctrl: equilibrium: Convert to use struct pingroup
  2023-11-22 16:35   ` Andy Shevchenko
@ 2023-11-23  3:11     ` kernel test robot
  -1 siblings, 0 replies; 50+ messages in thread
From: kernel test robot @ 2023-11-23  3:11 UTC (permalink / raw)
  To: Andy Shevchenko, Linus Walleij, Bartosz Golaszewski,
	Rasmus Villemoes, Krzysztof Kozlowski, Uwe Kleine-König,
	Geert Uytterhoeven, Biju Das, Claudiu Beznea, Jianlong Huang,
	linux-arm-kernel, linux-gpio, linux-kernel, linux-mediatek,
	openbmc, linux-mips, linux-arm-msm, linux-renesas-soc
  Cc: llvm, oe-kbuild-all, Ray Jui, Scott Branden,
	Broadcom internal kernel review list, Dong Aisheng,
	Fabio Estevam, Shawn Guo, Jacky Bai, Pengutronix Kernel Team,
	Sascha Hauer, NXP Linux Team, Sean Wang,
	Jonathan Neuschäfer

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 geert-renesas-drivers/renesas-pinctrl pinctrl-samsung/for-next linus/master v6.7-rc2 next-20231122]
[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-equilibrium-Convert-to-use-struct-pingroup/20231123-005932
base:   https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git devel
patch link:    https://lore.kernel.org/r/20231122164040.2262742-2-andriy.shevchenko%40linux.intel.com
patch subject: [PATCH v1 01/17] pinctrl: equilibrium: Convert to use struct pingroup
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20231123/202311230820.oBQop844-lkp@intel.com/config)
compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231123/202311230820.oBQop844-lkp@intel.com/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 <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202311230820.oBQop844-lkp@intel.com/

All errors (new ones prefixed by >>):

>> drivers/pinctrl/pinctrl-equilibrium.c:750:17: error: read-only variable is not assignable
                           grp->pins[j] = pin_id;
                           ~~~~~~~~~~~~ ^
>> drivers/pinctrl/pinctrl-equilibrium.c:761:23: error: no member named 'num_pins' in 'struct pingroup'
                                                   grp->pins, grp->num_pins,
                                                              ~~~  ^
   2 errors generated.


vim +750 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 *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			grp->pins = devm_kcalloc(dev, grp->npins, sizeof(*grp->pins), GFP_KERNEL);
   726			if (!grp->pins) {
   727				of_node_put(np);
   728				return -ENOMEM;
   729			}
   730	
   731			pinmux = devm_kcalloc(dev, grp->npins, sizeof(*pinmux), GFP_KERNEL);
   732			if (!pinmux) {
   733				of_node_put(np);
   734				return -ENOMEM;
   735			}
   736	
   737			for (j = 0; j < grp->npins; j++) {
   738				if (of_property_read_u32_index(np, "pins", j, &pin_id)) {
   739					dev_err(dev, "Group %s: Read intel pins id failed\n",
   740						grp->name);
   741					of_node_put(np);
   742					return -EINVAL;
   743				}
   744				if (pin_id >= drvdata->pctl_desc.npins) {
   745					dev_err(dev, "Group %s: Invalid pin ID, idx: %d, pin %u\n",
   746						grp->name, j, pin_id);
   747					of_node_put(np);
   748					return -EINVAL;
   749				}
 > 750				grp->pins[j] = pin_id;
   751				if (of_property_read_u32_index(np, "pinmux", j, &pinmux_id)) {
   752					dev_err(dev, "Group %s: Read intel pinmux id failed\n",
   753						grp->name);
   754					of_node_put(np);
   755					return -EINVAL;
   756				}
   757				pinmux[j] = pinmux_id;
   758			}
   759	
   760			err = pinctrl_generic_add_group(drvdata->pctl_dev, grp->name,
 > 761							grp->pins, grp->num_pins,
   762							pinmux);
   763			if (err < 0) {
   764				dev_err(dev, "Failed to register group %s\n", grp->name);
   765				of_node_put(np);
   766				return err;
   767			}
   768			memset(&group, 0, sizeof(group));
   769			pinmux = NULL;
   770		}
   771	
   772		return 0;
   773	}
   774	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH v1 01/17] pinctrl: equilibrium: Convert to use struct pingroup
@ 2023-11-23  3:11     ` kernel test robot
  0 siblings, 0 replies; 50+ messages in thread
From: kernel test robot @ 2023-11-23  3:11 UTC (permalink / raw)
  To: Andy Shevchenko, Linus Walleij, Bartosz Golaszewski,
	Rasmus Villemoes, Krzysztof Kozlowski, Uwe Kleine-König,
	Geert Uytterhoeven, Biju Das, Claudiu Beznea, Jianlong Huang,
	linux-arm-kernel, linux-gpio, linux-kernel, linux-mediatek,
	openbmc, linux-mips, linux-arm-msm, linux-renesas-soc
  Cc: llvm, oe-kbuild-all, Ray Jui, Scott Branden,
	Broadcom internal kernel review list, Dong Aisheng,
	Fabio Estevam, Shawn Guo, Jacky Bai, Pengutronix Kernel Team,
	Sascha Hauer, NXP Linux Team, Sean Wang,
	Jonathan Neuschäfer

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 geert-renesas-drivers/renesas-pinctrl pinctrl-samsung/for-next linus/master v6.7-rc2 next-20231122]
[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-equilibrium-Convert-to-use-struct-pingroup/20231123-005932
base:   https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git devel
patch link:    https://lore.kernel.org/r/20231122164040.2262742-2-andriy.shevchenko%40linux.intel.com
patch subject: [PATCH v1 01/17] pinctrl: equilibrium: Convert to use struct pingroup
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20231123/202311230820.oBQop844-lkp@intel.com/config)
compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231123/202311230820.oBQop844-lkp@intel.com/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 <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202311230820.oBQop844-lkp@intel.com/

All errors (new ones prefixed by >>):

>> drivers/pinctrl/pinctrl-equilibrium.c:750:17: error: read-only variable is not assignable
                           grp->pins[j] = pin_id;
                           ~~~~~~~~~~~~ ^
>> drivers/pinctrl/pinctrl-equilibrium.c:761:23: error: no member named 'num_pins' in 'struct pingroup'
                                                   grp->pins, grp->num_pins,
                                                              ~~~  ^
   2 errors generated.


vim +750 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 *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			grp->pins = devm_kcalloc(dev, grp->npins, sizeof(*grp->pins), GFP_KERNEL);
   726			if (!grp->pins) {
   727				of_node_put(np);
   728				return -ENOMEM;
   729			}
   730	
   731			pinmux = devm_kcalloc(dev, grp->npins, sizeof(*pinmux), GFP_KERNEL);
   732			if (!pinmux) {
   733				of_node_put(np);
   734				return -ENOMEM;
   735			}
   736	
   737			for (j = 0; j < grp->npins; j++) {
   738				if (of_property_read_u32_index(np, "pins", j, &pin_id)) {
   739					dev_err(dev, "Group %s: Read intel pins id failed\n",
   740						grp->name);
   741					of_node_put(np);
   742					return -EINVAL;
   743				}
   744				if (pin_id >= drvdata->pctl_desc.npins) {
   745					dev_err(dev, "Group %s: Invalid pin ID, idx: %d, pin %u\n",
   746						grp->name, j, pin_id);
   747					of_node_put(np);
   748					return -EINVAL;
   749				}
 > 750				grp->pins[j] = pin_id;
   751				if (of_property_read_u32_index(np, "pinmux", j, &pinmux_id)) {
   752					dev_err(dev, "Group %s: Read intel pinmux id failed\n",
   753						grp->name);
   754					of_node_put(np);
   755					return -EINVAL;
   756				}
   757				pinmux[j] = pinmux_id;
   758			}
   759	
   760			err = pinctrl_generic_add_group(drvdata->pctl_dev, grp->name,
 > 761							grp->pins, grp->num_pins,
   762							pinmux);
   763			if (err < 0) {
   764				dev_err(dev, "Failed to register group %s\n", grp->name);
   765				of_node_put(np);
   766				return err;
   767			}
   768			memset(&group, 0, sizeof(group));
   769			pinmux = NULL;
   770		}
   771	
   772		return 0;
   773	}
   774	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH v1 01/17] pinctrl: equilibrium: Convert to use struct pingroup
  2023-11-22 16:35   ` Andy Shevchenko
@ 2023-11-23  3:11     ` kernel test robot
  -1 siblings, 0 replies; 50+ messages in thread
From: kernel test robot @ 2023-11-23  3:11 UTC (permalink / raw)
  To: Andy Shevchenko, Linus Walleij, Bartosz Golaszewski,
	Rasmus Villemoes, Krzysztof Kozlowski, Uwe Kleine-König,
	Geert Uytterhoeven, Biju Das, Claudiu Beznea, Jianlong Huang,
	linux-arm-kernel, linux-gpio, linux-kernel, linux-mediatek,
	openbmc, linux-mips, linux-arm-msm, linux-renesas-soc
  Cc: oe-kbuild-all, Ray Jui, Scott Branden,
	Broadcom internal kernel review list, Dong Aisheng,
	Fabio Estevam, Shawn Guo, Jacky Bai, Pengutronix Kernel Team,
	Sascha Hauer, NXP Linux Team, Sean Wang,
	Jonathan Neuschäfer

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 geert-renesas-drivers/renesas-pinctrl pinctrl-samsung/for-next linus/master v6.7-rc2 next-20231122]
[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-equilibrium-Convert-to-use-struct-pingroup/20231123-005932
base:   https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git devel
patch link:    https://lore.kernel.org/r/20231122164040.2262742-2-andriy.shevchenko%40linux.intel.com
patch subject: [PATCH v1 01/17] pinctrl: equilibrium: Convert to use struct pingroup
config: i386-randconfig-001-20231123 (https://download.01.org/0day-ci/archive/20231123/202311230820.MGDyVHJW-lkp@intel.com/config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231123/202311230820.MGDyVHJW-lkp@intel.com/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 <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202311230820.MGDyVHJW-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/pinctrl/pinctrl-equilibrium.c: In function 'eqbr_build_groups':
   drivers/pinctrl/pinctrl-equilibrium.c:750:17: error: assignment of read-only location '*(grp->pins + (sizetype)((unsigned int)j * 4))'
     750 |    grp->pins[j] = pin_id;
         |                 ^
   drivers/pinctrl/pinctrl-equilibrium.c:761:23: error: 'struct pingroup' has no member named 'num_pins'; did you mean 'npins'?
     761 |       grp->pins, grp->num_pins,
         |                       ^~~~~~~~
         |                       npins
>> drivers/pinctrl/pinctrl-equilibrium.c:761:10: warning: passing argument 3 of 'pinctrl_generic_add_group' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     761 |       grp->pins, grp->num_pins,
         |       ~~~^~~~~~
   In file included from drivers/pinctrl/pinctrl-equilibrium.c:16:
   drivers/pinctrl/core.h:225:15: note: expected 'int *' but argument is of type 'const unsigned int *'
     225 |          int *gpins, int ngpins, void *data);
         |          ~~~~~^~~~~


vim +761 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 *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			grp->pins = devm_kcalloc(dev, grp->npins, sizeof(*grp->pins), GFP_KERNEL);
   726			if (!grp->pins) {
   727				of_node_put(np);
   728				return -ENOMEM;
   729			}
   730	
   731			pinmux = devm_kcalloc(dev, grp->npins, sizeof(*pinmux), GFP_KERNEL);
   732			if (!pinmux) {
   733				of_node_put(np);
   734				return -ENOMEM;
   735			}
   736	
   737			for (j = 0; j < grp->npins; j++) {
   738				if (of_property_read_u32_index(np, "pins", j, &pin_id)) {
   739					dev_err(dev, "Group %s: Read intel pins id failed\n",
   740						grp->name);
   741					of_node_put(np);
   742					return -EINVAL;
   743				}
   744				if (pin_id >= drvdata->pctl_desc.npins) {
   745					dev_err(dev, "Group %s: Invalid pin ID, idx: %d, pin %u\n",
   746						grp->name, j, pin_id);
   747					of_node_put(np);
   748					return -EINVAL;
   749				}
   750				grp->pins[j] = pin_id;
   751				if (of_property_read_u32_index(np, "pinmux", j, &pinmux_id)) {
   752					dev_err(dev, "Group %s: Read intel pinmux id failed\n",
   753						grp->name);
   754					of_node_put(np);
   755					return -EINVAL;
   756				}
   757				pinmux[j] = pinmux_id;
   758			}
   759	
   760			err = pinctrl_generic_add_group(drvdata->pctl_dev, grp->name,
 > 761							grp->pins, grp->num_pins,
   762							pinmux);
   763			if (err < 0) {
   764				dev_err(dev, "Failed to register group %s\n", grp->name);
   765				of_node_put(np);
   766				return err;
   767			}
   768			memset(&group, 0, sizeof(group));
   769			pinmux = NULL;
   770		}
   771	
   772		return 0;
   773	}
   774	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH v1 01/17] pinctrl: equilibrium: Convert to use struct pingroup
@ 2023-11-23  3:11     ` kernel test robot
  0 siblings, 0 replies; 50+ messages in thread
From: kernel test robot @ 2023-11-23  3:11 UTC (permalink / raw)
  To: Andy Shevchenko, Linus Walleij, Bartosz Golaszewski,
	Rasmus Villemoes, Krzysztof Kozlowski, Uwe Kleine-König,
	Geert Uytterhoeven, Biju Das, Claudiu Beznea, Jianlong Huang,
	linux-arm-kernel, linux-gpio, linux-kernel, linux-mediatek,
	openbmc, linux-mips, linux-arm-msm, linux-renesas-soc
  Cc: oe-kbuild-all, Ray Jui, Scott Branden,
	Broadcom internal kernel review list, Dong Aisheng,
	Fabio Estevam, Shawn Guo, Jacky Bai, Pengutronix Kernel Team,
	Sascha Hauer, NXP Linux Team, Sean Wang,
	Jonathan Neuschäfer

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 geert-renesas-drivers/renesas-pinctrl pinctrl-samsung/for-next linus/master v6.7-rc2 next-20231122]
[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-equilibrium-Convert-to-use-struct-pingroup/20231123-005932
base:   https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git devel
patch link:    https://lore.kernel.org/r/20231122164040.2262742-2-andriy.shevchenko%40linux.intel.com
patch subject: [PATCH v1 01/17] pinctrl: equilibrium: Convert to use struct pingroup
config: i386-randconfig-001-20231123 (https://download.01.org/0day-ci/archive/20231123/202311230820.MGDyVHJW-lkp@intel.com/config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231123/202311230820.MGDyVHJW-lkp@intel.com/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 <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202311230820.MGDyVHJW-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/pinctrl/pinctrl-equilibrium.c: In function 'eqbr_build_groups':
   drivers/pinctrl/pinctrl-equilibrium.c:750:17: error: assignment of read-only location '*(grp->pins + (sizetype)((unsigned int)j * 4))'
     750 |    grp->pins[j] = pin_id;
         |                 ^
   drivers/pinctrl/pinctrl-equilibrium.c:761:23: error: 'struct pingroup' has no member named 'num_pins'; did you mean 'npins'?
     761 |       grp->pins, grp->num_pins,
         |                       ^~~~~~~~
         |                       npins
>> drivers/pinctrl/pinctrl-equilibrium.c:761:10: warning: passing argument 3 of 'pinctrl_generic_add_group' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     761 |       grp->pins, grp->num_pins,
         |       ~~~^~~~~~
   In file included from drivers/pinctrl/pinctrl-equilibrium.c:16:
   drivers/pinctrl/core.h:225:15: note: expected 'int *' but argument is of type 'const unsigned int *'
     225 |          int *gpins, int ngpins, void *data);
         |          ~~~~~^~~~~


vim +761 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 *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			grp->pins = devm_kcalloc(dev, grp->npins, sizeof(*grp->pins), GFP_KERNEL);
   726			if (!grp->pins) {
   727				of_node_put(np);
   728				return -ENOMEM;
   729			}
   730	
   731			pinmux = devm_kcalloc(dev, grp->npins, sizeof(*pinmux), GFP_KERNEL);
   732			if (!pinmux) {
   733				of_node_put(np);
   734				return -ENOMEM;
   735			}
   736	
   737			for (j = 0; j < grp->npins; j++) {
   738				if (of_property_read_u32_index(np, "pins", j, &pin_id)) {
   739					dev_err(dev, "Group %s: Read intel pins id failed\n",
   740						grp->name);
   741					of_node_put(np);
   742					return -EINVAL;
   743				}
   744				if (pin_id >= drvdata->pctl_desc.npins) {
   745					dev_err(dev, "Group %s: Invalid pin ID, idx: %d, pin %u\n",
   746						grp->name, j, pin_id);
   747					of_node_put(np);
   748					return -EINVAL;
   749				}
   750				grp->pins[j] = pin_id;
   751				if (of_property_read_u32_index(np, "pinmux", j, &pinmux_id)) {
   752					dev_err(dev, "Group %s: Read intel pinmux id failed\n",
   753						grp->name);
   754					of_node_put(np);
   755					return -EINVAL;
   756				}
   757				pinmux[j] = pinmux_id;
   758			}
   759	
   760			err = pinctrl_generic_add_group(drvdata->pctl_dev, grp->name,
 > 761							grp->pins, grp->num_pins,
   762							pinmux);
   763			if (err < 0) {
   764				dev_err(dev, "Failed to register group %s\n", grp->name);
   765				of_node_put(np);
   766				return err;
   767			}
   768			memset(&group, 0, sizeof(group));
   769			pinmux = NULL;
   770		}
   771	
   772		return 0;
   773	}
   774	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH v1 00/17] pinctrl: Convert struct group_desc to use struct pingroup
  2023-11-22 16:35 ` Andy Shevchenko
  (?)
@ 2023-11-23 11:10   ` J. Neuschäfer
  -1 siblings, 0 replies; 50+ messages in thread
From: J. Neuschäfer @ 2023-11-23 11:10 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Linus Walleij, Bartosz Golaszewski, Rasmus Villemoes,
	Krzysztof Kozlowski, Uwe Kleine-König, Geert Uytterhoeven,
	Biju Das, Claudiu Beznea, Jianlong Huang, linux-arm-kernel,
	linux-gpio, linux-kernel, linux-mediatek, openbmc, linux-mips,
	linux-arm-msm, linux-renesas-soc, Ray Jui, Scott Branden,
	Broadcom internal kernel review list, Dong Aisheng,
	Fabio Estevam, Shawn Guo, Jacky Bai, Pengutronix Kernel Team,
	Sascha Hauer, NXP Linux Team, Sean Wang,
	Jonathan Neuschäfer, Paul Cercueil, Lakshmi Sowjanya D,
	Bjorn Andersson, Andy Gross, Konrad Dybcio, Emil Renner Berthing,
	Hal Feng, Basavaraj Natikar

[-- Attachment #1: Type: text/plain, Size: 972 bytes --]

On Wed, Nov 22, 2023 at 06:35:32PM +0200, Andy Shevchenko 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.

It is strange to me that struct pingroup was introduced without any
reference to the pre-existing struct group_desc, but it's good to see
them unified at last.

Even better might be to move the definitions next to each other in the
same file, so that anyone who finds one, also finds the other.


Thanks,
Jonathan

> 
> 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.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH v1 00/17] pinctrl: Convert struct group_desc to use struct pingroup
@ 2023-11-23 11:10   ` J. Neuschäfer
  0 siblings, 0 replies; 50+ messages in thread
From: J. Neuschäfer @ 2023-11-23 11:10 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Linus Walleij, Bartosz Golaszewski, Rasmus Villemoes,
	Krzysztof Kozlowski, Uwe Kleine-König, Geert Uytterhoeven,
	Biju Das, Claudiu Beznea, Jianlong Huang, linux-arm-kernel,
	linux-gpio, linux-kernel, linux-mediatek, openbmc, linux-mips,
	linux-arm-msm, linux-renesas-soc, Ray Jui, Scott Branden,
	Broadcom internal kernel review list, Dong Aisheng,
	Fabio Estevam, Shawn Guo, Jacky Bai, Pengutronix Kernel Team,
	Sascha Hauer, NXP Linux Team, Sean Wang,
	Jonathan Neuschäfer, Paul Cercueil, Lakshmi Sowjanya D,
	Bjorn Andersson, Andy Gross, Konrad Dybcio, Emil Renner Berthing,
	Hal Feng, Basavaraj Natikar


[-- Attachment #1.1: Type: text/plain, Size: 972 bytes --]

On Wed, Nov 22, 2023 at 06:35:32PM +0200, Andy Shevchenko 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.

It is strange to me that struct pingroup was introduced without any
reference to the pre-existing struct group_desc, but it's good to see
them unified at last.

Even better might be to move the definitions next to each other in the
same file, so that anyone who finds one, also finds the other.


Thanks,
Jonathan

> 
> 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.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH v1 00/17] pinctrl: Convert struct group_desc to use struct pingroup
@ 2023-11-23 11:10   ` J. Neuschäfer
  0 siblings, 0 replies; 50+ messages in thread
From: J. Neuschäfer @ 2023-11-23 11:10 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Claudiu Beznea, Geert Uytterhoeven, Basavaraj Natikar,
	Linus Walleij, Rasmus Villemoes, linux-mips, Paul Cercueil,
	Fabio Estevam, Jacky Bai, Konrad Dybcio, Bartosz Golaszewski,
	openbmc, Hal Feng, Andy Gross,
	Broadcom internal kernel review list, NXP Linux Team, Ray Jui,
	Emil Renner Berthing, linux-arm-msm, Sascha Hauer,
	Uwe Kleine-König, Jonathan Neuschäfer, linux-gpio,
	linux-mediatek

[-- Attachment #1: Type: text/plain, Size: 972 bytes --]

On Wed, Nov 22, 2023 at 06:35:32PM +0200, Andy Shevchenko 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.

It is strange to me that struct pingroup was introduced without any
reference to the pre-existing struct group_desc, but it's good to see
them unified at last.

Even better might be to move the definitions next to each other in the
same file, so that anyone who finds one, also finds the other.


Thanks,
Jonathan

> 
> 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.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH v1 02/17] pinctrl: nuvoton: Convert to use struct pingroup and PINCTRL_PINGROUP()
  2023-11-22 16:35   ` Andy Shevchenko
  (?)
@ 2023-11-23 11:11     ` J. Neuschäfer
  -1 siblings, 0 replies; 50+ messages in thread
From: J. Neuschäfer @ 2023-11-23 11:11 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Linus Walleij, Bartosz Golaszewski, Rasmus Villemoes,
	Krzysztof Kozlowski, Uwe Kleine-König, Geert Uytterhoeven,
	Biju Das, Claudiu Beznea, Jianlong Huang, linux-arm-kernel,
	linux-gpio, linux-kernel, linux-mediatek, openbmc, linux-mips,
	linux-arm-msm, linux-renesas-soc, Ray Jui, Scott Branden,
	Broadcom internal kernel review list, Dong Aisheng,
	Fabio Estevam, Shawn Guo, Jacky Bai, Pengutronix Kernel Team,
	Sascha Hauer, NXP Linux Team, Sean Wang,
	Jonathan Neuschäfer, Paul Cercueil, Lakshmi Sowjanya D,
	Bjorn Andersson, Andy Gross, Konrad Dybcio, Emil Renner Berthing,
	Hal Feng

[-- Attachment #1: Type: text/plain, Size: 1843 bytes --]

On Wed, Nov 22, 2023 at 06:35:34PM +0200, Andy Shevchenko wrote:
> The pin control header provides struct pingroup and PINCTRL_PINGROUP() macro.
> Utilize them instead of open coded variants in the driver.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---

Reviewed-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>

Thanks.

>  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
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH v1 02/17] pinctrl: nuvoton: Convert to use struct pingroup and PINCTRL_PINGROUP()
@ 2023-11-23 11:11     ` J. Neuschäfer
  0 siblings, 0 replies; 50+ messages in thread
From: J. Neuschäfer @ 2023-11-23 11:11 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Linus Walleij, Bartosz Golaszewski, Rasmus Villemoes,
	Krzysztof Kozlowski, Uwe Kleine-König, Geert Uytterhoeven,
	Biju Das, Claudiu Beznea, Jianlong Huang, linux-arm-kernel,
	linux-gpio, linux-kernel, linux-mediatek, openbmc, linux-mips,
	linux-arm-msm, linux-renesas-soc, Ray Jui, Scott Branden,
	Broadcom internal kernel review list, Dong Aisheng,
	Fabio Estevam, Shawn Guo, Jacky Bai, Pengutronix Kernel Team,
	Sascha Hauer, NXP Linux Team, Sean Wang,
	Jonathan Neuschäfer, Paul Cercueil, Lakshmi Sowjanya D,
	Bjorn Andersson, Andy Gross, Konrad Dybcio, Emil Renner Berthing,
	Hal Feng


[-- Attachment #1.1: Type: text/plain, Size: 1843 bytes --]

On Wed, Nov 22, 2023 at 06:35:34PM +0200, Andy Shevchenko wrote:
> The pin control header provides struct pingroup and PINCTRL_PINGROUP() macro.
> Utilize them instead of open coded variants in the driver.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---

Reviewed-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>

Thanks.

>  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
> 

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH v1 02/17] pinctrl: nuvoton: Convert to use struct pingroup and PINCTRL_PINGROUP()
@ 2023-11-23 11:11     ` J. Neuschäfer
  0 siblings, 0 replies; 50+ messages in thread
From: J. Neuschäfer @ 2023-11-23 11:11 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Claudiu Beznea, Geert Uytterhoeven, Linus Walleij,
	Rasmus Villemoes, linux-mips, Paul Cercueil, Fabio Estevam,
	Jacky Bai, Konrad Dybcio, Bartosz Golaszewski, openbmc, Hal Feng,
	Andy Gross, Broadcom internal kernel review list, NXP Linux Team,
	Ray Jui, Emil Renner Berthing, linux-arm-msm, Sascha Hauer,
	Uwe Kleine-König, Jonathan Neuschäfer, linux-gpio,
	linux-mediatek, Lakshmi Sowjanya D, Biju Das, linux-arm-kernel,
	Dong Aisheng, Scott Branden, Bjorn Andersson, Sean Wang,
	linux-kernel, linux-renesas-soc, Jianlong Huang,
	Krzysztof Kozlowski, Pengutronix Kernel Team, Shawn Guo

[-- Attachment #1: Type: text/plain, Size: 1843 bytes --]

On Wed, Nov 22, 2023 at 06:35:34PM +0200, Andy Shevchenko wrote:
> The pin control header provides struct pingroup and PINCTRL_PINGROUP() macro.
> Utilize them instead of open coded variants in the driver.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---

Reviewed-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>

Thanks.

>  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
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH v1 00/17] pinctrl: Convert struct group_desc to use struct pingroup
  2023-11-23 11:10   ` J. Neuschäfer
@ 2023-11-23 16:09     ` Andy Shevchenko
  -1 siblings, 0 replies; 50+ messages in thread
From: Andy Shevchenko @ 2023-11-23 16:09 UTC (permalink / raw)
  To: J. Neuschäfer
  Cc: Linus Walleij, Bartosz Golaszewski, Rasmus Villemoes,
	Krzysztof Kozlowski, Uwe Kleine-König, Geert Uytterhoeven,
	Biju Das, Claudiu Beznea, Jianlong Huang, linux-arm-kernel,
	linux-gpio, linux-kernel, linux-mediatek, openbmc, linux-mips,
	linux-arm-msm, linux-renesas-soc, Ray Jui, Scott Branden,
	Broadcom internal kernel review list, Dong Aisheng,
	Fabio Estevam, Shawn Guo, Jacky Bai, Pengutronix Kernel Team,
	Sascha Hauer, NXP Linux Team, Sean Wang, Paul Cercueil,
	Lakshmi Sowjanya D, Bjorn Andersson, Andy Gross, Konrad Dybcio,
	Emil Renner Berthing, Hal Feng, Basavaraj Natikar

On Thu, Nov 23, 2023 at 12:10:57PM +0100, J. Neuschäfer wrote:
> On Wed, Nov 22, 2023 at 06:35:32PM +0200, Andy Shevchenko 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.
> 
> It is strange to me that struct pingroup was introduced without any
> reference to the pre-existing struct group_desc, but it's good to see
> them unified at last.

Yep!

> Even better might be to move the definitions next to each other in the
> same file, so that anyone who finds one, also finds the other.

group_desc is a private to pin control generic implementation, pingroup is
generic for any pin control driver. Their current split is a right thing
to do, so no action required in this sense.

Thank you for review!

> > 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.

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH v1 00/17] pinctrl: Convert struct group_desc to use struct pingroup
@ 2023-11-23 16:09     ` Andy Shevchenko
  0 siblings, 0 replies; 50+ messages in thread
From: Andy Shevchenko @ 2023-11-23 16:09 UTC (permalink / raw)
  To: J. Neuschäfer
  Cc: Linus Walleij, Bartosz Golaszewski, Rasmus Villemoes,
	Krzysztof Kozlowski, Uwe Kleine-König, Geert Uytterhoeven,
	Biju Das, Claudiu Beznea, Jianlong Huang, linux-arm-kernel,
	linux-gpio, linux-kernel, linux-mediatek, openbmc, linux-mips,
	linux-arm-msm, linux-renesas-soc, Ray Jui, Scott Branden,
	Broadcom internal kernel review list, Dong Aisheng,
	Fabio Estevam, Shawn Guo, Jacky Bai, Pengutronix Kernel Team,
	Sascha Hauer, NXP Linux Team, Sean Wang, Paul Cercueil,
	Lakshmi Sowjanya D, Bjorn Andersson, Andy Gross, Konrad Dybcio,
	Emil Renner Berthing, Hal Feng, Basavaraj Natikar

On Thu, Nov 23, 2023 at 12:10:57PM +0100, J. Neuschäfer wrote:
> On Wed, Nov 22, 2023 at 06:35:32PM +0200, Andy Shevchenko 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.
> 
> It is strange to me that struct pingroup was introduced without any
> reference to the pre-existing struct group_desc, but it's good to see
> them unified at last.

Yep!

> Even better might be to move the definitions next to each other in the
> same file, so that anyone who finds one, also finds the other.

group_desc is a private to pin control generic implementation, pingroup is
generic for any pin control driver. Their current split is a right thing
to do, so no action required in this sense.

Thank you for review!

> > 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.

-- 
With Best Regards,
Andy Shevchenko



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 50+ messages in thread

end of thread, other threads:[~2023-11-26 22:51 UTC | newest]

Thread overview: 50+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-22 16:35 [PATCH v1 00/17] pinctrl: Convert struct group_desc to use struct pingroup Andy Shevchenko
2023-11-22 16:35 ` Andy Shevchenko
2023-11-22 16:35 ` [PATCH v1 01/17] pinctrl: equilibrium: Convert " Andy Shevchenko
2023-11-22 16:35   ` Andy Shevchenko
2023-11-23  3:11   ` kernel test robot
2023-11-23  3:11     ` kernel test robot
2023-11-23  3:11   ` kernel test robot
2023-11-23  3:11     ` kernel test robot
2023-11-22 16:35 ` [PATCH v1 02/17] pinctrl: nuvoton: Convert to use struct pingroup and PINCTRL_PINGROUP() Andy Shevchenko
2023-11-22 16:35   ` Andy Shevchenko
2023-11-23 11:11   ` J. Neuschäfer
2023-11-23 11:11     ` J. Neuschäfer
2023-11-23 11:11     ` J. Neuschäfer
2023-11-22 16:35 ` [PATCH v1 03/17] pinctrl: qcom: lpass-lpi: Replace kernel.h with what is being used Andy Shevchenko
2023-11-22 16:35   ` Andy Shevchenko
2023-11-22 16:35 ` [PATCH v1 04/17] pinctrl: qcom: lpass-lpi: Remove unused member in struct lpi_pingroup Andy Shevchenko
2023-11-22 16:35   ` Andy Shevchenko
2023-11-22 16:35 ` [PATCH v1 05/17] pinctrl: core: Add a convenient define PINCTRL_GROUP_DESC() Andy Shevchenko
2023-11-22 16:35   ` Andy Shevchenko
2023-11-22 16:35 ` [PATCH v1 06/17] pinctrl: ingenic: Make use of PINCTRL_GROUP_DESC() Andy Shevchenko
2023-11-22 16:35   ` Andy Shevchenko
2023-11-22 16:35 ` [PATCH v1 07/17] pinctrl: mediatek: " Andy Shevchenko
2023-11-22 16:35   ` Andy Shevchenko
2023-11-22 16:35 ` [PATCH v1 08/17] pinctrl: core: Embed struct pingroup into struct group_desc Andy Shevchenko
2023-11-22 16:35   ` Andy Shevchenko
2023-11-23  3:11   ` kernel test robot
2023-11-23  3:11     ` kernel test robot
2023-11-22 16:35 ` [PATCH v1 09/17] pinctrl: bcm: Convert to use grp member Andy Shevchenko
2023-11-22 16:35   ` Andy Shevchenko
2023-11-22 16:35 ` [PATCH v1 10/17] pinctrl: equilibrium: " Andy Shevchenko
2023-11-22 16:35   ` Andy Shevchenko
2023-11-22 16:35 ` [PATCH v1 11/17] pinctrl: imx: " Andy Shevchenko
2023-11-22 16:35   ` Andy Shevchenko
2023-11-22 16:35 ` [PATCH v1 12/17] pinctrl: ingenic: " Andy Shevchenko
2023-11-22 16:35   ` Andy Shevchenko
2023-11-22 16:35 ` [PATCH v1 13/17] pinctrl: keembay: " Andy Shevchenko
2023-11-22 16:35   ` Andy Shevchenko
2023-11-22 16:35 ` [PATCH v1 14/17] pinctrl: mediatek: " Andy Shevchenko
2023-11-22 16:35   ` Andy Shevchenko
2023-11-22 16:35 ` [PATCH v1 15/17] pinctrl: renesas: " Andy Shevchenko
2023-11-22 16:35   ` Andy Shevchenko
2023-11-22 16:35 ` [PATCH v1 16/17] pinctrl: starfive: " Andy Shevchenko
2023-11-22 16:35   ` Andy Shevchenko
2023-11-22 16:35 ` [PATCH v1 17/17] pinctrl: core: Remove unused members from struct group_desc Andy Shevchenko
2023-11-22 16:35   ` Andy Shevchenko
2023-11-23 11:10 ` [PATCH v1 00/17] pinctrl: Convert struct group_desc to use struct pingroup J. Neuschäfer
2023-11-23 11:10   ` J. Neuschäfer
2023-11-23 11:10   ` J. Neuschäfer
2023-11-23 16:09   ` Andy Shevchenko
2023-11-23 16:09     ` Andy Shevchenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.