linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/17] pinctrl: Constify pointers to 'pinctrl_desc' and more
@ 2025-05-28 10:40 Krzysztof Kozlowski
  2025-05-28 10:40 ` [PATCH 01/17] pinctrl: starfive: Allow compile testing on other platforms Krzysztof Kozlowski
                   ` (17 more replies)
  0 siblings, 18 replies; 35+ messages in thread
From: Krzysztof Kozlowski @ 2025-05-28 10:40 UTC (permalink / raw)
  To: Linus Walleij, Basavaraj Natikar, Shyam Sundar S K,
	Andrew Jeffery, Joel Stanley, Avi Fishman, Tomer Maimon,
	Tali Perry, Patrick Venture, Nancy Yuen, Benjamin Fair,
	Jonathan Neuschäfer, Rafał Miłecki,
	Broadcom internal kernel review list, Ray Jui, Scott Branden,
	Geert Uytterhoeven, David Rhodes, Richard Fitzgerald,
	Charles Keepax, Lorenzo Bianconi, Sean Wang, Jesper Nilsson,
	Lars Persson, Manivannan Sadhasivam, Damien Le Moal,
	Vladimir Zapolskiy, Michal Simek, Emil Renner Berthing,
	Jianlong Huang, Hal Feng, Matthias Brugger,
	AngeloGioacchino Del Regno, Alexandre Belloni, Maxime Coquelin,
	Alexandre Torgue
  Cc: linux-gpio, linux-kernel, linux-aspeed, openbmc, linux-arm-kernel,
	linux-renesas-soc, linux-sound, patches, linux-mediatek,
	linux-arm-kernel, linux-riscv, linux-rtc, linux-stm32,
	Krzysztof Kozlowski

In several drivers pointers to 'struct pinctrl_desc' is not modified, so
since core does not modify it, it can be made as const.

Dependencies/merging:
Patch #4 "pinctrl: Constify pointers to 'pinctrl_desc'" is a
prerequisite for all further patches, including RTC patch, therefore
probably everything should be via main pinctrl tree.

I split several patches, although not all, per SoC-submaintainers, so
reviewing will be easier.

Best regards,
Krzysztof

---
Krzysztof Kozlowski (17):
      pinctrl: starfive: Allow compile testing on other platforms
      pinctrl: Allow compile testing for K210, TB10X and ZYNQ
      pinctrl: amd: Constify pointers to 'pinctrl_desc'
      pinctrl: Constify pointers to 'pinctrl_desc'
      pinctrl: aspeed: Constify static 'pinctrl_desc'
      pinctrl: nuvoton: Constify static 'pinctrl_desc'
      pinctrl: bcm: Constify static 'pinctrl_desc'
      pinctrl: bcm: cygnus-mux: Move fixed assignments to 'pinctrl_desc' definition
      pinctrl: bcm: cygnus-ns2: Move fixed assignments to 'pinctrl_desc' definition
      pinctrl: bcm: cygnus-nsp: Move fixed assignments to 'pinctrl_desc' definition
      pinctrl: as3722: Move fixed assignments to 'pinctrl_desc' definition
      pinctrl: max77620: Move fixed assignments to 'pinctrl_desc' definition
      pinctrl: palmas: Move fixed assignments to 'pinctrl_desc' definition
      pinctrl: renesas: Move fixed assignments to 'pinctrl_desc' definition
      pinctrl: pistachio: Constify static 'pinctrl_desc'
      pinctrl: Constify static 'pinctrl_desc'
      rtc: stm32: Constify static 'pinctrl_desc'

 drivers/pinctrl/Kconfig                            |  8 ++++----
 drivers/pinctrl/Makefile                           |  2 +-
 drivers/pinctrl/aspeed/pinctrl-aspeed-g4.c         |  2 +-
 drivers/pinctrl/aspeed/pinctrl-aspeed-g5.c         |  2 +-
 drivers/pinctrl/aspeed/pinctrl-aspeed-g6.c         |  2 +-
 drivers/pinctrl/aspeed/pinctrl-aspeed.c            |  2 +-
 drivers/pinctrl/aspeed/pinctrl-aspeed.h            |  2 +-
 drivers/pinctrl/bcm/pinctrl-bcm4908.c              |  2 +-
 drivers/pinctrl/bcm/pinctrl-cygnus-mux.c           |  8 ++++----
 drivers/pinctrl/bcm/pinctrl-ns.c                   |  2 +-
 drivers/pinctrl/bcm/pinctrl-ns2-mux.c              |  8 ++++----
 drivers/pinctrl/bcm/pinctrl-nsp-mux.c              |  8 ++++----
 drivers/pinctrl/berlin/berlin.c                    |  2 +-
 drivers/pinctrl/cirrus/pinctrl-cs42l43.c           |  2 +-
 drivers/pinctrl/core.c                             | 13 +++++++------
 drivers/pinctrl/core.h                             |  2 +-
 drivers/pinctrl/mediatek/pinctrl-airoha.c          |  2 +-
 drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c          |  2 +-
 drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c          |  2 +-
 drivers/pinctrl/nuvoton/pinctrl-wpcm450.c          |  2 +-
 drivers/pinctrl/pinctrl-amd.c                      |  8 ++++----
 drivers/pinctrl/pinctrl-artpec6.c                  |  2 +-
 drivers/pinctrl/pinctrl-as3722.c                   |  4 ++--
 drivers/pinctrl/pinctrl-bm1880.c                   |  2 +-
 drivers/pinctrl/pinctrl-k210.c                     |  2 +-
 drivers/pinctrl/pinctrl-lpc18xx.c                  |  2 +-
 drivers/pinctrl/pinctrl-max77620.c                 |  9 ++++-----
 drivers/pinctrl/pinctrl-mlxbf3.c                   |  2 +-
 drivers/pinctrl/pinctrl-palmas.c                   |  4 ++--
 drivers/pinctrl/pinctrl-pistachio.c                |  8 ++++----
 drivers/pinctrl/pinctrl-tb10x.c                    |  2 +-
 drivers/pinctrl/pinctrl-zynq.c                     |  2 +-
 drivers/pinctrl/renesas/pinctrl-rzn1.c             |  4 ++--
 drivers/pinctrl/starfive/pinctrl-starfive-jh7100.c |  2 +-
 drivers/rtc/rtc-stm32.c                            |  2 +-
 include/linux/pinctrl/pinctrl.h                    |  8 ++++----
 36 files changed, 69 insertions(+), 69 deletions(-)
---
base-commit: 08ea0cc455fbf6f6719b7a4cdcd1d132ea34577b
change-id: 20250528-pinctrl-const-desc-3a40e39eca15

Best regards,
-- 
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>


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

* [PATCH 01/17] pinctrl: starfive: Allow compile testing on other platforms
  2025-05-28 10:40 [PATCH 00/17] pinctrl: Constify pointers to 'pinctrl_desc' and more Krzysztof Kozlowski
@ 2025-05-28 10:40 ` Krzysztof Kozlowski
  2025-05-28 12:36   ` Geert Uytterhoeven
  2025-05-28 10:40 ` [PATCH 02/17] pinctrl: Allow compile testing for K210, TB10X and ZYNQ Krzysztof Kozlowski
                   ` (16 subsequent siblings)
  17 siblings, 1 reply; 35+ messages in thread
From: Krzysztof Kozlowski @ 2025-05-28 10:40 UTC (permalink / raw)
  To: Linus Walleij, Basavaraj Natikar, Shyam Sundar S K,
	Andrew Jeffery, Joel Stanley, Avi Fishman, Tomer Maimon,
	Tali Perry, Patrick Venture, Nancy Yuen, Benjamin Fair,
	Jonathan Neuschäfer, Rafał Miłecki,
	Broadcom internal kernel review list, Ray Jui, Scott Branden,
	Geert Uytterhoeven, David Rhodes, Richard Fitzgerald,
	Charles Keepax, Lorenzo Bianconi, Sean Wang, Jesper Nilsson,
	Lars Persson, Manivannan Sadhasivam, Damien Le Moal,
	Vladimir Zapolskiy, Michal Simek, Emil Renner Berthing,
	Jianlong Huang, Hal Feng, Matthias Brugger,
	AngeloGioacchino Del Regno, Alexandre Belloni, Maxime Coquelin,
	Alexandre Torgue
  Cc: linux-gpio, linux-kernel, linux-aspeed, openbmc, linux-arm-kernel,
	linux-renesas-soc, linux-sound, patches, linux-mediatek,
	linux-arm-kernel, linux-riscv, linux-rtc, linux-stm32,
	Krzysztof Kozlowski

Always descent to drivers/pinctrl/starfive/ because limiting it with
SOC_STARFIVE is redundant since all of its Kconfig entries are already
have "depends on SOC_STARFIVE".  This allows compile testing on other
architectures with allyesconfig.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 drivers/pinctrl/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pinctrl/Makefile b/drivers/pinctrl/Makefile
index ac27e88677d14f1c697e0d0be9f295c746556f4d..dcede70b25660833a158c298d1269d6ecea9dd8b 100644
--- a/drivers/pinctrl/Makefile
+++ b/drivers/pinctrl/Makefile
@@ -82,7 +82,7 @@ obj-y				+= sophgo/
 obj-y				+= spacemit/
 obj-$(CONFIG_PINCTRL_SPEAR)	+= spear/
 obj-y				+= sprd/
-obj-$(CONFIG_SOC_STARFIVE)	+= starfive/
+obj-y				+= starfive/
 obj-$(CONFIG_PINCTRL_STM32)	+= stm32/
 obj-y				+= sunplus/
 obj-$(CONFIG_PINCTRL_SUNXI)	+= sunxi/

-- 
2.45.2


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

* [PATCH 02/17] pinctrl: Allow compile testing for K210, TB10X and ZYNQ
  2025-05-28 10:40 [PATCH 00/17] pinctrl: Constify pointers to 'pinctrl_desc' and more Krzysztof Kozlowski
  2025-05-28 10:40 ` [PATCH 01/17] pinctrl: starfive: Allow compile testing on other platforms Krzysztof Kozlowski
@ 2025-05-28 10:40 ` Krzysztof Kozlowski
  2025-05-29  6:26   ` Krzysztof Kozlowski
  2025-05-28 10:40 ` [PATCH 03/17] pinctrl: amd: Constify pointers to 'pinctrl_desc' Krzysztof Kozlowski
                   ` (15 subsequent siblings)
  17 siblings, 1 reply; 35+ messages in thread
From: Krzysztof Kozlowski @ 2025-05-28 10:40 UTC (permalink / raw)
  To: Linus Walleij, Basavaraj Natikar, Shyam Sundar S K,
	Andrew Jeffery, Joel Stanley, Avi Fishman, Tomer Maimon,
	Tali Perry, Patrick Venture, Nancy Yuen, Benjamin Fair,
	Jonathan Neuschäfer, Rafał Miłecki,
	Broadcom internal kernel review list, Ray Jui, Scott Branden,
	Geert Uytterhoeven, David Rhodes, Richard Fitzgerald,
	Charles Keepax, Lorenzo Bianconi, Sean Wang, Jesper Nilsson,
	Lars Persson, Manivannan Sadhasivam, Damien Le Moal,
	Vladimir Zapolskiy, Michal Simek, Emil Renner Berthing,
	Jianlong Huang, Hal Feng, Matthias Brugger,
	AngeloGioacchino Del Regno, Alexandre Belloni, Maxime Coquelin,
	Alexandre Torgue
  Cc: linux-gpio, linux-kernel, linux-aspeed, openbmc, linux-arm-kernel,
	linux-renesas-soc, linux-sound, patches, linux-mediatek,
	linux-arm-kernel, linux-riscv, linux-rtc, linux-stm32,
	Krzysztof Kozlowski

Pinctrl drivers for K210, TB10X and ZYNQ do not reference any machine
headers, thus can be compile tested for increased build coverage.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 drivers/pinctrl/Kconfig | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig
index 33db9104df178e5a3148b60c3c6bd153113385d3..77a5d13e899f8c5251987c2c74df1d05dbd59128 100644
--- a/drivers/pinctrl/Kconfig
+++ b/drivers/pinctrl/Kconfig
@@ -269,7 +269,7 @@ config PINCTRL_INGENIC
 
 config PINCTRL_K210
 	bool "Pinctrl driver for the Canaan Kendryte K210 SoC"
-	depends on RISCV && SOC_CANAAN_K210 && OF
+	depends on RISCV && SOC_CANAAN_K210 && OF || COMPILE_TEST
 	select GENERIC_PINMUX_FUNCTIONS
 	select GENERIC_PINCONF
 	select GPIOLIB
@@ -554,8 +554,8 @@ config PINCTRL_SX150X
 	  - 16 bits: sx1509q, sx1506q
 
 config PINCTRL_TB10X
-	bool
-	depends on OF && ARC_PLAT_TB10X
+	bool "Pinctrl for TB10X" if COMPILE_TEST
+	depends on OF && ARC_PLAT_TB10X || COMPILE_TEST
 	select GPIOLIB
 
 config PINCTRL_TPS6594
@@ -590,7 +590,7 @@ config PINCTRL_TH1520
 
 config PINCTRL_ZYNQ
 	bool "Pinctrl driver for Xilinx Zynq"
-	depends on ARCH_ZYNQ
+	depends on ARCH_ZYNQ || COMPILE_TEST
 	select PINMUX
 	select GENERIC_PINCONF
 	help

-- 
2.45.2


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

* [PATCH 03/17] pinctrl: amd: Constify pointers to 'pinctrl_desc'
  2025-05-28 10:40 [PATCH 00/17] pinctrl: Constify pointers to 'pinctrl_desc' and more Krzysztof Kozlowski
  2025-05-28 10:40 ` [PATCH 01/17] pinctrl: starfive: Allow compile testing on other platforms Krzysztof Kozlowski
  2025-05-28 10:40 ` [PATCH 02/17] pinctrl: Allow compile testing for K210, TB10X and ZYNQ Krzysztof Kozlowski
@ 2025-05-28 10:40 ` Krzysztof Kozlowski
  2025-05-28 10:41 ` [PATCH 04/17] pinctrl: " Krzysztof Kozlowski
                   ` (14 subsequent siblings)
  17 siblings, 0 replies; 35+ messages in thread
From: Krzysztof Kozlowski @ 2025-05-28 10:40 UTC (permalink / raw)
  To: Linus Walleij, Basavaraj Natikar, Shyam Sundar S K,
	Andrew Jeffery, Joel Stanley, Avi Fishman, Tomer Maimon,
	Tali Perry, Patrick Venture, Nancy Yuen, Benjamin Fair,
	Jonathan Neuschäfer, Rafał Miłecki,
	Broadcom internal kernel review list, Ray Jui, Scott Branden,
	Geert Uytterhoeven, David Rhodes, Richard Fitzgerald,
	Charles Keepax, Lorenzo Bianconi, Sean Wang, Jesper Nilsson,
	Lars Persson, Manivannan Sadhasivam, Damien Le Moal,
	Vladimir Zapolskiy, Michal Simek, Emil Renner Berthing,
	Jianlong Huang, Hal Feng, Matthias Brugger,
	AngeloGioacchino Del Regno, Alexandre Belloni, Maxime Coquelin,
	Alexandre Torgue
  Cc: linux-gpio, linux-kernel, linux-aspeed, openbmc, linux-arm-kernel,
	linux-renesas-soc, linux-sound, patches, linux-mediatek,
	linux-arm-kernel, linux-riscv, linux-rtc, linux-stm32,
	Krzysztof Kozlowski

Internal functions obtaining pointers to 'struct pinctrl_desc' do not
modify the contents so they can be made pointers to const.  This makes
code safer, explicit and later allows constifying 'pinctrl_desc' in
pinctrl core code.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 drivers/pinctrl/pinctrl-amd.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-amd.c b/drivers/pinctrl/pinctrl-amd.c
index 5cf3db6d78b79af9ac5e7226de239a0d2f9aaacc..85617cfed2299e131c110e9d4084370790106404 100644
--- a/drivers/pinctrl/pinctrl-amd.c
+++ b/drivers/pinctrl/pinctrl-amd.c
@@ -872,7 +872,7 @@ static const struct pinconf_ops amd_pinconf_ops = {
 
 static void amd_gpio_irq_init(struct amd_gpio *gpio_dev)
 {
-	struct pinctrl_desc *desc = gpio_dev->pctrl->desc;
+	const struct pinctrl_desc *desc = gpio_dev->pctrl->desc;
 	unsigned long flags;
 	u32 pin_reg, mask;
 	int i;
@@ -901,7 +901,7 @@ static void amd_gpio_irq_init(struct amd_gpio *gpio_dev)
 static void amd_gpio_check_pending(void)
 {
 	struct amd_gpio *gpio_dev = pinctrl_dev;
-	struct pinctrl_desc *desc = gpio_dev->pctrl->desc;
+	const struct pinctrl_desc *desc = gpio_dev->pctrl->desc;
 	int i;
 
 	if (!pm_debug_messages_on)
@@ -957,7 +957,7 @@ static bool amd_gpio_should_save(struct amd_gpio *gpio_dev, unsigned int pin)
 static int amd_gpio_suspend_hibernate_common(struct device *dev, bool is_suspend)
 {
 	struct amd_gpio *gpio_dev = dev_get_drvdata(dev);
-	struct pinctrl_desc *desc = gpio_dev->pctrl->desc;
+	const struct pinctrl_desc *desc = gpio_dev->pctrl->desc;
 	unsigned long flags;
 	int i;
 	u32 wake_mask = is_suspend ? WAKE_SOURCE_SUSPEND : WAKE_SOURCE_HIBERNATE;
@@ -1001,7 +1001,7 @@ static int amd_gpio_hibernate(struct device *dev)
 static int amd_gpio_resume(struct device *dev)
 {
 	struct amd_gpio *gpio_dev = dev_get_drvdata(dev);
-	struct pinctrl_desc *desc = gpio_dev->pctrl->desc;
+	const struct pinctrl_desc *desc = gpio_dev->pctrl->desc;
 	unsigned long flags;
 	int i;
 

-- 
2.45.2


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

* [PATCH 04/17] pinctrl: Constify pointers to 'pinctrl_desc'
  2025-05-28 10:40 [PATCH 00/17] pinctrl: Constify pointers to 'pinctrl_desc' and more Krzysztof Kozlowski
                   ` (2 preceding siblings ...)
  2025-05-28 10:40 ` [PATCH 03/17] pinctrl: amd: Constify pointers to 'pinctrl_desc' Krzysztof Kozlowski
@ 2025-05-28 10:41 ` Krzysztof Kozlowski
  2025-05-28 12:47   ` Geert Uytterhoeven
  2025-05-28 10:41 ` [PATCH 05/17] pinctrl: aspeed: Constify static 'pinctrl_desc' Krzysztof Kozlowski
                   ` (13 subsequent siblings)
  17 siblings, 1 reply; 35+ messages in thread
From: Krzysztof Kozlowski @ 2025-05-28 10:41 UTC (permalink / raw)
  To: Linus Walleij, Basavaraj Natikar, Shyam Sundar S K,
	Andrew Jeffery, Joel Stanley, Avi Fishman, Tomer Maimon,
	Tali Perry, Patrick Venture, Nancy Yuen, Benjamin Fair,
	Jonathan Neuschäfer, Rafał Miłecki,
	Broadcom internal kernel review list, Ray Jui, Scott Branden,
	Geert Uytterhoeven, David Rhodes, Richard Fitzgerald,
	Charles Keepax, Lorenzo Bianconi, Sean Wang, Jesper Nilsson,
	Lars Persson, Manivannan Sadhasivam, Damien Le Moal,
	Vladimir Zapolskiy, Michal Simek, Emil Renner Berthing,
	Jianlong Huang, Hal Feng, Matthias Brugger,
	AngeloGioacchino Del Regno, Alexandre Belloni, Maxime Coquelin,
	Alexandre Torgue
  Cc: linux-gpio, linux-kernel, linux-aspeed, openbmc, linux-arm-kernel,
	linux-renesas-soc, linux-sound, patches, linux-mediatek,
	linux-arm-kernel, linux-riscv, linux-rtc, linux-stm32,
	Krzysztof Kozlowski

Pin controller core code only stores the pointer to
'struct pinctrl_desc' and does not modify it anywhere.  The pointer can
be changed to pointer to const which makes the code safer, explicit and
later allows constifying 'pinctrl_desc' allocations in individual
drivers.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

---

This is the pre-requisite patch for all further patches.
---
 drivers/pinctrl/core.c          | 13 +++++++------
 drivers/pinctrl/core.h          |  2 +-
 include/linux/pinctrl/pinctrl.h |  8 ++++----
 3 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c
index 9046292d1360218bc70eff418fb8d1028c22b11a..73b78d6eac672095c8556763af1744be6f558501 100644
--- a/drivers/pinctrl/core.c
+++ b/drivers/pinctrl/core.c
@@ -2062,7 +2062,7 @@ static int pinctrl_check_ops(struct pinctrl_dev *pctldev)
  * @driver_data: private pin controller data for this pin controller
  */
 static struct pinctrl_dev *
-pinctrl_init_controller(struct pinctrl_desc *pctldesc, struct device *dev,
+pinctrl_init_controller(const struct pinctrl_desc *pctldesc, struct device *dev,
 			void *driver_data)
 {
 	struct pinctrl_dev *pctldev;
@@ -2132,7 +2132,8 @@ pinctrl_init_controller(struct pinctrl_desc *pctldesc, struct device *dev,
 	return ERR_PTR(ret);
 }
 
-static void pinctrl_uninit_controller(struct pinctrl_dev *pctldev, struct pinctrl_desc *pctldesc)
+static void pinctrl_uninit_controller(struct pinctrl_dev *pctldev,
+				      const struct pinctrl_desc *pctldesc)
 {
 	pinctrl_free_pindescs(pctldev, pctldesc->pins,
 			      pctldesc->npins);
@@ -2209,7 +2210,7 @@ EXPORT_SYMBOL_GPL(pinctrl_enable);
  * struct pinctrl_dev handle. To avoid issues later on, please use the
  * new pinctrl_register_and_init() below instead.
  */
-struct pinctrl_dev *pinctrl_register(struct pinctrl_desc *pctldesc,
+struct pinctrl_dev *pinctrl_register(const struct pinctrl_desc *pctldesc,
 				    struct device *dev, void *driver_data)
 {
 	struct pinctrl_dev *pctldev;
@@ -2239,7 +2240,7 @@ EXPORT_SYMBOL_GPL(pinctrl_register);
  * Note that pinctrl_enable() still needs to be manually called after
  * this once the driver is ready.
  */
-int pinctrl_register_and_init(struct pinctrl_desc *pctldesc,
+int pinctrl_register_and_init(const struct pinctrl_desc *pctldesc,
 			      struct device *dev, void *driver_data,
 			      struct pinctrl_dev **pctldev)
 {
@@ -2330,7 +2331,7 @@ static int devm_pinctrl_dev_match(struct device *dev, void *res, void *data)
  * The pinctrl device will be automatically released when the device is unbound.
  */
 struct pinctrl_dev *devm_pinctrl_register(struct device *dev,
-					  struct pinctrl_desc *pctldesc,
+					  const struct pinctrl_desc *pctldesc,
 					  void *driver_data)
 {
 	struct pinctrl_dev **ptr, *pctldev;
@@ -2364,7 +2365,7 @@ EXPORT_SYMBOL_GPL(devm_pinctrl_register);
  * The pinctrl device will be automatically released when the device is unbound.
  */
 int devm_pinctrl_register_and_init(struct device *dev,
-				   struct pinctrl_desc *pctldesc,
+				   const struct pinctrl_desc *pctldesc,
 				   void *driver_data,
 				   struct pinctrl_dev **pctldev)
 {
diff --git a/drivers/pinctrl/core.h b/drivers/pinctrl/core.h
index d6c24978e7081a663b8a0fa6cb9314670575b1bc..fc513a9cdd4f2f9dd4ec4a088eee53fdbd673285 100644
--- a/drivers/pinctrl/core.h
+++ b/drivers/pinctrl/core.h
@@ -51,7 +51,7 @@ struct pinctrl_state;
  */
 struct pinctrl_dev {
 	struct list_head node;
-	struct pinctrl_desc *desc;
+	const struct pinctrl_desc *desc;
 	struct radix_tree_root pin_desc_tree;
 #ifdef CONFIG_GENERIC_PINCTRL_GROUPS
 	struct radix_tree_root pin_group_tree;
diff --git a/include/linux/pinctrl/pinctrl.h b/include/linux/pinctrl/pinctrl.h
index 9a8189ffd0f2c28c88640280deee194d17d18400..d138e18156452e008f24ca06358fcab45135632f 100644
--- a/include/linux/pinctrl/pinctrl.h
+++ b/include/linux/pinctrl/pinctrl.h
@@ -165,25 +165,25 @@ struct pinctrl_desc {
 
 /* External interface to pin controller */
 
-extern int pinctrl_register_and_init(struct pinctrl_desc *pctldesc,
+extern int pinctrl_register_and_init(const struct pinctrl_desc *pctldesc,
 				     struct device *dev, void *driver_data,
 				     struct pinctrl_dev **pctldev);
 extern int pinctrl_enable(struct pinctrl_dev *pctldev);
 
 /* Please use pinctrl_register_and_init() and pinctrl_enable() instead */
-extern struct pinctrl_dev *pinctrl_register(struct pinctrl_desc *pctldesc,
+extern struct pinctrl_dev *pinctrl_register(const struct pinctrl_desc *pctldesc,
 				struct device *dev, void *driver_data);
 
 extern void pinctrl_unregister(struct pinctrl_dev *pctldev);
 
 extern int devm_pinctrl_register_and_init(struct device *dev,
-				struct pinctrl_desc *pctldesc,
+				const struct pinctrl_desc *pctldesc,
 				void *driver_data,
 				struct pinctrl_dev **pctldev);
 
 /* Please use devm_pinctrl_register_and_init() instead */
 extern struct pinctrl_dev *devm_pinctrl_register(struct device *dev,
-				struct pinctrl_desc *pctldesc,
+				const struct pinctrl_desc *pctldesc,
 				void *driver_data);
 
 extern void devm_pinctrl_unregister(struct device *dev,

-- 
2.45.2


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

* [PATCH 05/17] pinctrl: aspeed: Constify static 'pinctrl_desc'
  2025-05-28 10:40 [PATCH 00/17] pinctrl: Constify pointers to 'pinctrl_desc' and more Krzysztof Kozlowski
                   ` (3 preceding siblings ...)
  2025-05-28 10:41 ` [PATCH 04/17] pinctrl: " Krzysztof Kozlowski
@ 2025-05-28 10:41 ` Krzysztof Kozlowski
  2025-05-29  0:39   ` Andrew Jeffery
  2025-05-28 10:41 ` [PATCH 06/17] pinctrl: nuvoton: " Krzysztof Kozlowski
                   ` (12 subsequent siblings)
  17 siblings, 1 reply; 35+ messages in thread
From: Krzysztof Kozlowski @ 2025-05-28 10:41 UTC (permalink / raw)
  To: Linus Walleij, Basavaraj Natikar, Shyam Sundar S K,
	Andrew Jeffery, Joel Stanley, Avi Fishman, Tomer Maimon,
	Tali Perry, Patrick Venture, Nancy Yuen, Benjamin Fair,
	Jonathan Neuschäfer, Rafał Miłecki,
	Broadcom internal kernel review list, Ray Jui, Scott Branden,
	Geert Uytterhoeven, David Rhodes, Richard Fitzgerald,
	Charles Keepax, Lorenzo Bianconi, Sean Wang, Jesper Nilsson,
	Lars Persson, Manivannan Sadhasivam, Damien Le Moal,
	Vladimir Zapolskiy, Michal Simek, Emil Renner Berthing,
	Jianlong Huang, Hal Feng, Matthias Brugger,
	AngeloGioacchino Del Regno, Alexandre Belloni, Maxime Coquelin,
	Alexandre Torgue
  Cc: linux-gpio, linux-kernel, linux-aspeed, openbmc, linux-arm-kernel,
	linux-renesas-soc, linux-sound, patches, linux-mediatek,
	linux-arm-kernel, linux-riscv, linux-rtc, linux-stm32,
	Krzysztof Kozlowski

The local static 'struct pinctrl_desc' is not modified, so can be made
const for code safety.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 drivers/pinctrl/aspeed/pinctrl-aspeed-g4.c | 2 +-
 drivers/pinctrl/aspeed/pinctrl-aspeed-g5.c | 2 +-
 drivers/pinctrl/aspeed/pinctrl-aspeed-g6.c | 2 +-
 drivers/pinctrl/aspeed/pinctrl-aspeed.c    | 2 +-
 drivers/pinctrl/aspeed/pinctrl-aspeed.h    | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/pinctrl/aspeed/pinctrl-aspeed-g4.c b/drivers/pinctrl/aspeed/pinctrl-aspeed-g4.c
index 774f8d05142f2d90c238f8e6661eca4685601db7..cb295856dda1244f2205305cf4c505d4ea4a326f 100644
--- a/drivers/pinctrl/aspeed/pinctrl-aspeed-g4.c
+++ b/drivers/pinctrl/aspeed/pinctrl-aspeed-g4.c
@@ -2653,7 +2653,7 @@ static const struct pinconf_ops aspeed_g4_conf_ops = {
 	.pin_config_group_set = aspeed_pin_config_group_set,
 };
 
-static struct pinctrl_desc aspeed_g4_pinctrl_desc = {
+static const struct pinctrl_desc aspeed_g4_pinctrl_desc = {
 	.name = "aspeed-g4-pinctrl",
 	.pins = aspeed_g4_pins,
 	.npins = ARRAY_SIZE(aspeed_g4_pins),
diff --git a/drivers/pinctrl/aspeed/pinctrl-aspeed-g5.c b/drivers/pinctrl/aspeed/pinctrl-aspeed-g5.c
index 5bb8fd0d1e41bda799119a67887ccbc277e0f9f4..792089628362a1ed1c3eccd4e46c41a3ac7a79f6 100644
--- a/drivers/pinctrl/aspeed/pinctrl-aspeed-g5.c
+++ b/drivers/pinctrl/aspeed/pinctrl-aspeed-g5.c
@@ -2845,7 +2845,7 @@ static const struct pinconf_ops aspeed_g5_conf_ops = {
 	.pin_config_group_set = aspeed_pin_config_group_set,
 };
 
-static struct pinctrl_desc aspeed_g5_pinctrl_desc = {
+static const struct pinctrl_desc aspeed_g5_pinctrl_desc = {
 	.name = "aspeed-g5-pinctrl",
 	.pins = aspeed_g5_pins,
 	.npins = ARRAY_SIZE(aspeed_g5_pins),
diff --git a/drivers/pinctrl/aspeed/pinctrl-aspeed-g6.c b/drivers/pinctrl/aspeed/pinctrl-aspeed-g6.c
index 5a7cd0a8868764dc5e3dc70f325c25ba29d50a64..51a63cf92023f7dc7a27466331c77bb5dcbaa9bb 100644
--- a/drivers/pinctrl/aspeed/pinctrl-aspeed-g6.c
+++ b/drivers/pinctrl/aspeed/pinctrl-aspeed-g6.c
@@ -2763,7 +2763,7 @@ static const struct pinconf_ops aspeed_g6_conf_ops = {
 	.pin_config_group_set = aspeed_pin_config_group_set,
 };
 
-static struct pinctrl_desc aspeed_g6_pinctrl_desc = {
+static const struct pinctrl_desc aspeed_g6_pinctrl_desc = {
 	.name = "aspeed-g6-pinctrl",
 	.pins = aspeed_g6_pins,
 	.npins = ARRAY_SIZE(aspeed_g6_pins),
diff --git a/drivers/pinctrl/aspeed/pinctrl-aspeed.c b/drivers/pinctrl/aspeed/pinctrl-aspeed.c
index 9c6ee46ac7a096ce693639d88d387b089ffe5239..7e0ebf11af163c90184231686b1e0d9920755d76 100644
--- a/drivers/pinctrl/aspeed/pinctrl-aspeed.c
+++ b/drivers/pinctrl/aspeed/pinctrl-aspeed.c
@@ -441,7 +441,7 @@ int aspeed_gpio_request_enable(struct pinctrl_dev *pctldev,
 }
 
 int aspeed_pinctrl_probe(struct platform_device *pdev,
-			 struct pinctrl_desc *pdesc,
+			 const struct pinctrl_desc *pdesc,
 			 struct aspeed_pinctrl_data *pdata)
 {
 	struct device *parent;
diff --git a/drivers/pinctrl/aspeed/pinctrl-aspeed.h b/drivers/pinctrl/aspeed/pinctrl-aspeed.h
index 4dcde3bc29c825cbc6be954dae9a654a310b4cd8..28f3bde25081b2c8099977129acdcdfb3e4b1dd5 100644
--- a/drivers/pinctrl/aspeed/pinctrl-aspeed.h
+++ b/drivers/pinctrl/aspeed/pinctrl-aspeed.h
@@ -102,7 +102,7 @@ int aspeed_gpio_request_enable(struct pinctrl_dev *pctldev,
 		struct pinctrl_gpio_range *range,
 		unsigned int offset);
 int aspeed_pinctrl_probe(struct platform_device *pdev,
-		struct pinctrl_desc *pdesc,
+		const struct pinctrl_desc *pdesc,
 		struct aspeed_pinctrl_data *pdata);
 int aspeed_pin_config_get(struct pinctrl_dev *pctldev, unsigned int offset,
 		unsigned long *config);

-- 
2.45.2


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

* [PATCH 06/17] pinctrl: nuvoton: Constify static 'pinctrl_desc'
  2025-05-28 10:40 [PATCH 00/17] pinctrl: Constify pointers to 'pinctrl_desc' and more Krzysztof Kozlowski
                   ` (4 preceding siblings ...)
  2025-05-28 10:41 ` [PATCH 05/17] pinctrl: aspeed: Constify static 'pinctrl_desc' Krzysztof Kozlowski
@ 2025-05-28 10:41 ` Krzysztof Kozlowski
  2025-05-28 10:41 ` [PATCH 07/17] pinctrl: bcm: " Krzysztof Kozlowski
                   ` (11 subsequent siblings)
  17 siblings, 0 replies; 35+ messages in thread
From: Krzysztof Kozlowski @ 2025-05-28 10:41 UTC (permalink / raw)
  To: Linus Walleij, Basavaraj Natikar, Shyam Sundar S K,
	Andrew Jeffery, Joel Stanley, Avi Fishman, Tomer Maimon,
	Tali Perry, Patrick Venture, Nancy Yuen, Benjamin Fair,
	Jonathan Neuschäfer, Rafał Miłecki,
	Broadcom internal kernel review list, Ray Jui, Scott Branden,
	Geert Uytterhoeven, David Rhodes, Richard Fitzgerald,
	Charles Keepax, Lorenzo Bianconi, Sean Wang, Jesper Nilsson,
	Lars Persson, Manivannan Sadhasivam, Damien Le Moal,
	Vladimir Zapolskiy, Michal Simek, Emil Renner Berthing,
	Jianlong Huang, Hal Feng, Matthias Brugger,
	AngeloGioacchino Del Regno, Alexandre Belloni, Maxime Coquelin,
	Alexandre Torgue
  Cc: linux-gpio, linux-kernel, linux-aspeed, openbmc, linux-arm-kernel,
	linux-renesas-soc, linux-sound, patches, linux-mediatek,
	linux-arm-kernel, linux-riscv, linux-rtc, linux-stm32,
	Krzysztof Kozlowski

The local static 'struct pinctrl_desc' is not modified, so can be made
const for code safety.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c | 2 +-
 drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c | 2 +-
 drivers/pinctrl/nuvoton/pinctrl-wpcm450.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c b/drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c
index dfd32feb34286b7a4d807e9033a11f507e277dce..b8872d8f5930ad931dad208afec4e08a23c3d653 100644
--- a/drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c
+++ b/drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c
@@ -1817,7 +1817,7 @@ static const struct pinconf_ops npcm7xx_pinconf_ops = {
 };
 
 /* pinctrl_desc */
-static struct pinctrl_desc npcm7xx_pinctrl_desc = {
+static const struct pinctrl_desc npcm7xx_pinctrl_desc = {
 	.name = "npcm7xx-pinctrl",
 	.pins = npcm7xx_pins,
 	.npins = ARRAY_SIZE(npcm7xx_pins),
diff --git a/drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c b/drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c
index be3db8ab406c416f0709d06eb864e33e3208541a..3c3b9d8d3681c64c21927615e1bb49f157f156b5 100644
--- a/drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c
+++ b/drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c
@@ -2299,7 +2299,7 @@ static const struct pinconf_ops npcm8xx_pinconf_ops = {
 };
 
 /* pinctrl_desc */
-static struct pinctrl_desc npcm8xx_pinctrl_desc = {
+static const struct pinctrl_desc npcm8xx_pinctrl_desc = {
 	.name = "npcm8xx-pinctrl",
 	.pins = npcm8xx_pins,
 	.npins = ARRAY_SIZE(npcm8xx_pins),
diff --git a/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c b/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c
index 4264ca749175a2ce0f3603c1d7aa271d98e6cd89..8d8314ba0e4cb55db2b1d3adf2de07e6fb93c279 100644
--- a/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c
+++ b/drivers/pinctrl/nuvoton/pinctrl-wpcm450.c
@@ -989,7 +989,7 @@ static const struct pinconf_ops wpcm450_pinconf_ops = {
 	.pin_config_set = wpcm450_config_set,
 };
 
-static struct pinctrl_desc wpcm450_pinctrl_desc = {
+static const struct pinctrl_desc wpcm450_pinctrl_desc = {
 	.name = "wpcm450-pinctrl",
 	.pins = wpcm450_pins,
 	.npins = ARRAY_SIZE(wpcm450_pins),

-- 
2.45.2


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

* [PATCH 07/17] pinctrl: bcm: Constify static 'pinctrl_desc'
  2025-05-28 10:40 [PATCH 00/17] pinctrl: Constify pointers to 'pinctrl_desc' and more Krzysztof Kozlowski
                   ` (5 preceding siblings ...)
  2025-05-28 10:41 ` [PATCH 06/17] pinctrl: nuvoton: " Krzysztof Kozlowski
@ 2025-05-28 10:41 ` Krzysztof Kozlowski
  2025-05-28 16:45   ` Florian Fainelli
  2025-05-28 10:41 ` [PATCH 08/17] pinctrl: bcm: cygnus-mux: Move fixed assignments to 'pinctrl_desc' definition Krzysztof Kozlowski
                   ` (10 subsequent siblings)
  17 siblings, 1 reply; 35+ messages in thread
From: Krzysztof Kozlowski @ 2025-05-28 10:41 UTC (permalink / raw)
  To: Linus Walleij, Basavaraj Natikar, Shyam Sundar S K,
	Andrew Jeffery, Joel Stanley, Avi Fishman, Tomer Maimon,
	Tali Perry, Patrick Venture, Nancy Yuen, Benjamin Fair,
	Jonathan Neuschäfer, Rafał Miłecki,
	Broadcom internal kernel review list, Ray Jui, Scott Branden,
	Geert Uytterhoeven, David Rhodes, Richard Fitzgerald,
	Charles Keepax, Lorenzo Bianconi, Sean Wang, Jesper Nilsson,
	Lars Persson, Manivannan Sadhasivam, Damien Le Moal,
	Vladimir Zapolskiy, Michal Simek, Emil Renner Berthing,
	Jianlong Huang, Hal Feng, Matthias Brugger,
	AngeloGioacchino Del Regno, Alexandre Belloni, Maxime Coquelin,
	Alexandre Torgue
  Cc: linux-gpio, linux-kernel, linux-aspeed, openbmc, linux-arm-kernel,
	linux-renesas-soc, linux-sound, patches, linux-mediatek,
	linux-arm-kernel, linux-riscv, linux-rtc, linux-stm32,
	Krzysztof Kozlowski

The local static 'struct pinctrl_desc' is not modified, so can be made
const for code safety.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 drivers/pinctrl/bcm/pinctrl-bcm4908.c | 2 +-
 drivers/pinctrl/bcm/pinctrl-ns.c      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pinctrl/bcm/pinctrl-bcm4908.c b/drivers/pinctrl/bcm/pinctrl-bcm4908.c
index f190e0997f1fa9fe8bf07fc3ae5700bc721e1651..12f7a253ea4d5bd0af5dbabc320fc2df32172e4f 100644
--- a/drivers/pinctrl/bcm/pinctrl-bcm4908.c
+++ b/drivers/pinctrl/bcm/pinctrl-bcm4908.c
@@ -456,7 +456,7 @@ static const struct pinmux_ops bcm4908_pinctrl_pmxops = {
  * Controller code
  */
 
-static struct pinctrl_desc bcm4908_pinctrl_desc = {
+static const struct pinctrl_desc bcm4908_pinctrl_desc = {
 	.name = "bcm4908-pinctrl",
 	.pctlops = &bcm4908_pinctrl_ops,
 	.pmxops = &bcm4908_pinctrl_pmxops,
diff --git a/drivers/pinctrl/bcm/pinctrl-ns.c b/drivers/pinctrl/bcm/pinctrl-ns.c
index 6bb2b461950bef5c420f1b250d48fcf6e907b98f..03bd01b4a945adf72445576a8a111f3c0637e095 100644
--- a/drivers/pinctrl/bcm/pinctrl-ns.c
+++ b/drivers/pinctrl/bcm/pinctrl-ns.c
@@ -192,7 +192,7 @@ static const struct pinmux_ops ns_pinctrl_pmxops = {
  * Controller code
  */
 
-static struct pinctrl_desc ns_pinctrl_desc = {
+static const struct pinctrl_desc ns_pinctrl_desc = {
 	.name = "pinctrl-ns",
 	.pctlops = &ns_pinctrl_ops,
 	.pmxops = &ns_pinctrl_pmxops,

-- 
2.45.2


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

* [PATCH 08/17] pinctrl: bcm: cygnus-mux: Move fixed assignments to 'pinctrl_desc' definition
  2025-05-28 10:40 [PATCH 00/17] pinctrl: Constify pointers to 'pinctrl_desc' and more Krzysztof Kozlowski
                   ` (6 preceding siblings ...)
  2025-05-28 10:41 ` [PATCH 07/17] pinctrl: bcm: " Krzysztof Kozlowski
@ 2025-05-28 10:41 ` Krzysztof Kozlowski
  2025-05-28 16:46   ` Florian Fainelli
  2025-05-28 10:41 ` [PATCH 09/17] pinctrl: bcm: cygnus-ns2: " Krzysztof Kozlowski
                   ` (9 subsequent siblings)
  17 siblings, 1 reply; 35+ messages in thread
From: Krzysztof Kozlowski @ 2025-05-28 10:41 UTC (permalink / raw)
  To: Linus Walleij, Basavaraj Natikar, Shyam Sundar S K,
	Andrew Jeffery, Joel Stanley, Avi Fishman, Tomer Maimon,
	Tali Perry, Patrick Venture, Nancy Yuen, Benjamin Fair,
	Jonathan Neuschäfer, Rafał Miłecki,
	Broadcom internal kernel review list, Ray Jui, Scott Branden,
	Geert Uytterhoeven, David Rhodes, Richard Fitzgerald,
	Charles Keepax, Lorenzo Bianconi, Sean Wang, Jesper Nilsson,
	Lars Persson, Manivannan Sadhasivam, Damien Le Moal,
	Vladimir Zapolskiy, Michal Simek, Emil Renner Berthing,
	Jianlong Huang, Hal Feng, Matthias Brugger,
	AngeloGioacchino Del Regno, Alexandre Belloni, Maxime Coquelin,
	Alexandre Torgue
  Cc: linux-gpio, linux-kernel, linux-aspeed, openbmc, linux-arm-kernel,
	linux-renesas-soc, linux-sound, patches, linux-mediatek,
	linux-arm-kernel, linux-riscv, linux-rtc, linux-stm32,
	Krzysztof Kozlowski

Assign 'struct pinctrl_desc' .npins member in definition to make clear
that number of pins is fixed and have less code in the probe.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 drivers/pinctrl/bcm/pinctrl-cygnus-mux.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/pinctrl/bcm/pinctrl-cygnus-mux.c b/drivers/pinctrl/bcm/pinctrl-cygnus-mux.c
index bf9597800954affd954e45a4baa01da4d5dbf420..e9aa99f85e05944a2a0cb9a3e6245c707dbc9b3a 100644
--- a/drivers/pinctrl/bcm/pinctrl-cygnus-mux.c
+++ b/drivers/pinctrl/bcm/pinctrl-cygnus-mux.c
@@ -903,6 +903,7 @@ static struct pinctrl_desc cygnus_pinctrl_desc = {
 	.name = "cygnus-pinmux",
 	.pctlops = &cygnus_pinctrl_ops,
 	.pmxops = &cygnus_pinmux_ops,
+	.npins = ARRAY_SIZE(cygnus_pins),
 };
 
 static int cygnus_mux_log_init(struct cygnus_pinctrl *pinctrl)
@@ -935,7 +936,6 @@ static int cygnus_pinmux_probe(struct platform_device *pdev)
 	struct cygnus_pinctrl *pinctrl;
 	int i, ret;
 	struct pinctrl_pin_desc *pins;
-	unsigned num_pins = ARRAY_SIZE(cygnus_pins);
 
 	pinctrl = devm_kzalloc(&pdev->dev, sizeof(*pinctrl), GFP_KERNEL);
 	if (!pinctrl)
@@ -963,11 +963,12 @@ static int cygnus_pinmux_probe(struct platform_device *pdev)
 		return ret;
 	}
 
-	pins = devm_kcalloc(&pdev->dev, num_pins, sizeof(*pins), GFP_KERNEL);
+	pins = devm_kcalloc(&pdev->dev, ARRAY_SIZE(cygnus_pins), sizeof(*pins),
+			    GFP_KERNEL);
 	if (!pins)
 		return -ENOMEM;
 
-	for (i = 0; i < num_pins; i++) {
+	for (i = 0; i < ARRAY_SIZE(cygnus_pins); i++) {
 		pins[i].number = cygnus_pins[i].pin;
 		pins[i].name = cygnus_pins[i].name;
 		pins[i].drv_data = &cygnus_pins[i].gpio_mux;
@@ -978,7 +979,6 @@ static int cygnus_pinmux_probe(struct platform_device *pdev)
 	pinctrl->functions = cygnus_pin_functions;
 	pinctrl->num_functions = ARRAY_SIZE(cygnus_pin_functions);
 	cygnus_pinctrl_desc.pins = pins;
-	cygnus_pinctrl_desc.npins = num_pins;
 
 	pinctrl->pctl = devm_pinctrl_register(&pdev->dev, &cygnus_pinctrl_desc,
 			pinctrl);

-- 
2.45.2


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

* [PATCH 09/17] pinctrl: bcm: cygnus-ns2: Move fixed assignments to 'pinctrl_desc' definition
  2025-05-28 10:40 [PATCH 00/17] pinctrl: Constify pointers to 'pinctrl_desc' and more Krzysztof Kozlowski
                   ` (7 preceding siblings ...)
  2025-05-28 10:41 ` [PATCH 08/17] pinctrl: bcm: cygnus-mux: Move fixed assignments to 'pinctrl_desc' definition Krzysztof Kozlowski
@ 2025-05-28 10:41 ` Krzysztof Kozlowski
  2025-05-28 16:46   ` Florian Fainelli
  2025-05-28 10:41 ` [PATCH 10/17] pinctrl: bcm: cygnus-nsp: " Krzysztof Kozlowski
                   ` (8 subsequent siblings)
  17 siblings, 1 reply; 35+ messages in thread
From: Krzysztof Kozlowski @ 2025-05-28 10:41 UTC (permalink / raw)
  To: Linus Walleij, Basavaraj Natikar, Shyam Sundar S K,
	Andrew Jeffery, Joel Stanley, Avi Fishman, Tomer Maimon,
	Tali Perry, Patrick Venture, Nancy Yuen, Benjamin Fair,
	Jonathan Neuschäfer, Rafał Miłecki,
	Broadcom internal kernel review list, Ray Jui, Scott Branden,
	Geert Uytterhoeven, David Rhodes, Richard Fitzgerald,
	Charles Keepax, Lorenzo Bianconi, Sean Wang, Jesper Nilsson,
	Lars Persson, Manivannan Sadhasivam, Damien Le Moal,
	Vladimir Zapolskiy, Michal Simek, Emil Renner Berthing,
	Jianlong Huang, Hal Feng, Matthias Brugger,
	AngeloGioacchino Del Regno, Alexandre Belloni, Maxime Coquelin,
	Alexandre Torgue
  Cc: linux-gpio, linux-kernel, linux-aspeed, openbmc, linux-arm-kernel,
	linux-renesas-soc, linux-sound, patches, linux-mediatek,
	linux-arm-kernel, linux-riscv, linux-rtc, linux-stm32,
	Krzysztof Kozlowski

Assign 'struct pinctrl_desc' .npins member in definition to make clear
that number of pins is fixed and have less code in the probe.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 drivers/pinctrl/bcm/pinctrl-ns2-mux.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/pinctrl/bcm/pinctrl-ns2-mux.c b/drivers/pinctrl/bcm/pinctrl-ns2-mux.c
index 04f4fca854cc05c6ccc75fbcb640b18fcfd37453..23ab3ab064b6f2b0aaa15afd6b9c582f1a1256b2 100644
--- a/drivers/pinctrl/bcm/pinctrl-ns2-mux.c
+++ b/drivers/pinctrl/bcm/pinctrl-ns2-mux.c
@@ -971,6 +971,7 @@ static struct pinctrl_desc ns2_pinctrl_desc = {
 	.pctlops = &ns2_pinctrl_ops,
 	.pmxops = &ns2_pinmux_ops,
 	.confops = &ns2_pinconf_ops,
+	.npins = ARRAY_SIZE(ns2_pins),
 };
 
 static int ns2_mux_log_init(struct ns2_pinctrl *pinctrl)
@@ -1026,7 +1027,6 @@ static int ns2_pinmux_probe(struct platform_device *pdev)
 	struct resource *res;
 	int i, ret;
 	struct pinctrl_pin_desc *pins;
-	unsigned int num_pins = ARRAY_SIZE(ns2_pins);
 
 	pinctrl = devm_kzalloc(&pdev->dev, sizeof(*pinctrl), GFP_KERNEL);
 	if (!pinctrl)
@@ -1060,11 +1060,12 @@ static int ns2_pinmux_probe(struct platform_device *pdev)
 		return ret;
 	}
 
-	pins = devm_kcalloc(&pdev->dev, num_pins, sizeof(*pins), GFP_KERNEL);
+	pins = devm_kcalloc(&pdev->dev, ARRAY_SIZE(ns2_pins), sizeof(*pins),
+			    GFP_KERNEL);
 	if (!pins)
 		return -ENOMEM;
 
-	for (i = 0; i < num_pins; i++) {
+	for (i = 0; i < ARRAY_SIZE(ns2_pins); i++) {
 		pins[i].number = ns2_pins[i].pin;
 		pins[i].name = ns2_pins[i].name;
 		pins[i].drv_data = &ns2_pins[i];
@@ -1075,7 +1076,6 @@ static int ns2_pinmux_probe(struct platform_device *pdev)
 	pinctrl->functions = ns2_pin_functions;
 	pinctrl->num_functions = ARRAY_SIZE(ns2_pin_functions);
 	ns2_pinctrl_desc.pins = pins;
-	ns2_pinctrl_desc.npins = num_pins;
 
 	pinctrl->pctl = pinctrl_register(&ns2_pinctrl_desc, &pdev->dev,
 			pinctrl);

-- 
2.45.2


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

* [PATCH 10/17] pinctrl: bcm: cygnus-nsp: Move fixed assignments to 'pinctrl_desc' definition
  2025-05-28 10:40 [PATCH 00/17] pinctrl: Constify pointers to 'pinctrl_desc' and more Krzysztof Kozlowski
                   ` (8 preceding siblings ...)
  2025-05-28 10:41 ` [PATCH 09/17] pinctrl: bcm: cygnus-ns2: " Krzysztof Kozlowski
@ 2025-05-28 10:41 ` Krzysztof Kozlowski
  2025-05-28 16:46   ` Florian Fainelli
  2025-05-28 10:41 ` [PATCH 11/17] pinctrl: as3722: " Krzysztof Kozlowski
                   ` (7 subsequent siblings)
  17 siblings, 1 reply; 35+ messages in thread
From: Krzysztof Kozlowski @ 2025-05-28 10:41 UTC (permalink / raw)
  To: Linus Walleij, Basavaraj Natikar, Shyam Sundar S K,
	Andrew Jeffery, Joel Stanley, Avi Fishman, Tomer Maimon,
	Tali Perry, Patrick Venture, Nancy Yuen, Benjamin Fair,
	Jonathan Neuschäfer, Rafał Miłecki,
	Broadcom internal kernel review list, Ray Jui, Scott Branden,
	Geert Uytterhoeven, David Rhodes, Richard Fitzgerald,
	Charles Keepax, Lorenzo Bianconi, Sean Wang, Jesper Nilsson,
	Lars Persson, Manivannan Sadhasivam, Damien Le Moal,
	Vladimir Zapolskiy, Michal Simek, Emil Renner Berthing,
	Jianlong Huang, Hal Feng, Matthias Brugger,
	AngeloGioacchino Del Regno, Alexandre Belloni, Maxime Coquelin,
	Alexandre Torgue
  Cc: linux-gpio, linux-kernel, linux-aspeed, openbmc, linux-arm-kernel,
	linux-renesas-soc, linux-sound, patches, linux-mediatek,
	linux-arm-kernel, linux-riscv, linux-rtc, linux-stm32,
	Krzysztof Kozlowski

Assign 'struct pinctrl_desc' .npins member in definition to make clear
that number of pins is fixed and have less code in the probe.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 drivers/pinctrl/bcm/pinctrl-nsp-mux.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/pinctrl/bcm/pinctrl-nsp-mux.c b/drivers/pinctrl/bcm/pinctrl-nsp-mux.c
index eb6298507c1d1873f9d5a90ec724b36af6d4da48..9b716c0d2b9456b9e64ca1094375effefdf4817c 100644
--- a/drivers/pinctrl/bcm/pinctrl-nsp-mux.c
+++ b/drivers/pinctrl/bcm/pinctrl-nsp-mux.c
@@ -525,6 +525,7 @@ static struct pinctrl_desc nsp_pinctrl_desc = {
 	.name = "nsp-pinmux",
 	.pctlops = &nsp_pinctrl_ops,
 	.pmxops = &nsp_pinmux_ops,
+	.npins = ARRAY_SIZE(nsp_pins),
 };
 
 static int nsp_mux_log_init(struct nsp_pinctrl *pinctrl)
@@ -556,7 +557,6 @@ static int nsp_pinmux_probe(struct platform_device *pdev)
 	struct resource *res;
 	int i, ret;
 	struct pinctrl_pin_desc *pins;
-	unsigned int num_pins = ARRAY_SIZE(nsp_pins);
 
 	pinctrl = devm_kzalloc(&pdev->dev, sizeof(*pinctrl), GFP_KERNEL);
 	if (!pinctrl)
@@ -589,11 +589,12 @@ static int nsp_pinmux_probe(struct platform_device *pdev)
 		return ret;
 	}
 
-	pins = devm_kcalloc(&pdev->dev, num_pins, sizeof(*pins), GFP_KERNEL);
+	pins = devm_kcalloc(&pdev->dev, ARRAY_SIZE(nsp_pins), sizeof(*pins),
+			    GFP_KERNEL);
 	if (!pins)
 		return -ENOMEM;
 
-	for (i = 0; i < num_pins; i++) {
+	for (i = 0; i < ARRAY_SIZE(nsp_pins); i++) {
 		pins[i].number = nsp_pins[i].pin;
 		pins[i].name = nsp_pins[i].name;
 		pins[i].drv_data = &nsp_pins[i].gpio_select;
@@ -604,7 +605,6 @@ static int nsp_pinmux_probe(struct platform_device *pdev)
 	pinctrl->functions = nsp_pin_functions;
 	pinctrl->num_functions = ARRAY_SIZE(nsp_pin_functions);
 	nsp_pinctrl_desc.pins = pins;
-	nsp_pinctrl_desc.npins = num_pins;
 
 	pinctrl->pctl = devm_pinctrl_register(&pdev->dev, &nsp_pinctrl_desc,
 					 pinctrl);

-- 
2.45.2


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

* [PATCH 11/17] pinctrl: as3722: Move fixed assignments to 'pinctrl_desc' definition
  2025-05-28 10:40 [PATCH 00/17] pinctrl: Constify pointers to 'pinctrl_desc' and more Krzysztof Kozlowski
                   ` (9 preceding siblings ...)
  2025-05-28 10:41 ` [PATCH 10/17] pinctrl: bcm: cygnus-nsp: " Krzysztof Kozlowski
@ 2025-05-28 10:41 ` Krzysztof Kozlowski
  2025-05-28 10:41 ` [PATCH 12/17] pinctrl: max77620: " Krzysztof Kozlowski
                   ` (6 subsequent siblings)
  17 siblings, 0 replies; 35+ messages in thread
From: Krzysztof Kozlowski @ 2025-05-28 10:41 UTC (permalink / raw)
  To: Linus Walleij, Basavaraj Natikar, Shyam Sundar S K,
	Andrew Jeffery, Joel Stanley, Avi Fishman, Tomer Maimon,
	Tali Perry, Patrick Venture, Nancy Yuen, Benjamin Fair,
	Jonathan Neuschäfer, Rafał Miłecki,
	Broadcom internal kernel review list, Ray Jui, Scott Branden,
	Geert Uytterhoeven, David Rhodes, Richard Fitzgerald,
	Charles Keepax, Lorenzo Bianconi, Sean Wang, Jesper Nilsson,
	Lars Persson, Manivannan Sadhasivam, Damien Le Moal,
	Vladimir Zapolskiy, Michal Simek, Emil Renner Berthing,
	Jianlong Huang, Hal Feng, Matthias Brugger,
	AngeloGioacchino Del Regno, Alexandre Belloni, Maxime Coquelin,
	Alexandre Torgue
  Cc: linux-gpio, linux-kernel, linux-aspeed, openbmc, linux-arm-kernel,
	linux-renesas-soc, linux-sound, patches, linux-mediatek,
	linux-arm-kernel, linux-riscv, linux-rtc, linux-stm32,
	Krzysztof Kozlowski

Assign 'struct pinctrl_desc' .pins and .npins members in definition to
make clear that number of pins is fixed and have less code in the probe.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 drivers/pinctrl/pinctrl-as3722.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-as3722.c b/drivers/pinctrl/pinctrl-as3722.c
index 0d8c75ce20eda97627aef773342a0b63ff6114a1..ed7b2c482ff0bb6a546955c083ef7046701527b0 100644
--- a/drivers/pinctrl/pinctrl-as3722.c
+++ b/drivers/pinctrl/pinctrl-as3722.c
@@ -422,6 +422,8 @@ static struct pinctrl_desc as3722_pinctrl_desc = {
 	.pmxops = &as3722_pinmux_ops,
 	.confops = &as3722_pinconf_ops,
 	.owner = THIS_MODULE,
+	.pins = as3722_pins_desc,
+	.npins = ARRAY_SIZE(as3722_pins_desc),
 };
 
 static int as3722_gpio_get(struct gpio_chip *chip, unsigned offset)
@@ -550,8 +552,6 @@ static int as3722_pinctrl_probe(struct platform_device *pdev)
 	as_pci->pin_groups = as3722_pingroups;
 	as_pci->num_pin_groups = ARRAY_SIZE(as3722_pingroups);
 	as3722_pinctrl_desc.name = dev_name(&pdev->dev);
-	as3722_pinctrl_desc.pins = as3722_pins_desc;
-	as3722_pinctrl_desc.npins = ARRAY_SIZE(as3722_pins_desc);
 	as_pci->pctl = devm_pinctrl_register(&pdev->dev, &as3722_pinctrl_desc,
 					     as_pci);
 	if (IS_ERR(as_pci->pctl)) {

-- 
2.45.2


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

* [PATCH 12/17] pinctrl: max77620: Move fixed assignments to 'pinctrl_desc' definition
  2025-05-28 10:40 [PATCH 00/17] pinctrl: Constify pointers to 'pinctrl_desc' and more Krzysztof Kozlowski
                   ` (10 preceding siblings ...)
  2025-05-28 10:41 ` [PATCH 11/17] pinctrl: as3722: " Krzysztof Kozlowski
@ 2025-05-28 10:41 ` Krzysztof Kozlowski
  2025-05-28 10:41 ` [PATCH 13/17] pinctrl: palmas: " Krzysztof Kozlowski
                   ` (5 subsequent siblings)
  17 siblings, 0 replies; 35+ messages in thread
From: Krzysztof Kozlowski @ 2025-05-28 10:41 UTC (permalink / raw)
  To: Linus Walleij, Basavaraj Natikar, Shyam Sundar S K,
	Andrew Jeffery, Joel Stanley, Avi Fishman, Tomer Maimon,
	Tali Perry, Patrick Venture, Nancy Yuen, Benjamin Fair,
	Jonathan Neuschäfer, Rafał Miłecki,
	Broadcom internal kernel review list, Ray Jui, Scott Branden,
	Geert Uytterhoeven, David Rhodes, Richard Fitzgerald,
	Charles Keepax, Lorenzo Bianconi, Sean Wang, Jesper Nilsson,
	Lars Persson, Manivannan Sadhasivam, Damien Le Moal,
	Vladimir Zapolskiy, Michal Simek, Emil Renner Berthing,
	Jianlong Huang, Hal Feng, Matthias Brugger,
	AngeloGioacchino Del Regno, Alexandre Belloni, Maxime Coquelin,
	Alexandre Torgue
  Cc: linux-gpio, linux-kernel, linux-aspeed, openbmc, linux-arm-kernel,
	linux-renesas-soc, linux-sound, patches, linux-mediatek,
	linux-arm-kernel, linux-riscv, linux-rtc, linux-stm32,
	Krzysztof Kozlowski

Assign 'struct pinctrl_desc' .pins, .npins and other members in
definition to make clear that number of pins is fixed and have less code
in the probe.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 drivers/pinctrl/pinctrl-max77620.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-max77620.c b/drivers/pinctrl/pinctrl-max77620.c
index d236daa7c13ebbcaf7c4a8d1a8bed751aa111c0f..acb945a2574368b2e34659a902c34df8aad193d7 100644
--- a/drivers/pinctrl/pinctrl-max77620.c
+++ b/drivers/pinctrl/pinctrl-max77620.c
@@ -543,6 +543,10 @@ static struct pinctrl_desc max77620_pinctrl_desc = {
 	.pctlops = &max77620_pinctrl_ops,
 	.pmxops = &max77620_pinmux_ops,
 	.confops = &max77620_pinconf_ops,
+	.pins = max77620_pins_desc,
+	.npins = ARRAY_SIZE(max77620_pins_desc),
+	.num_custom_params = ARRAY_SIZE(max77620_cfg_params),
+	.custom_params = max77620_cfg_params,
 };
 
 static int max77620_pinctrl_probe(struct platform_device *pdev)
@@ -569,11 +573,6 @@ static int max77620_pinctrl_probe(struct platform_device *pdev)
 	platform_set_drvdata(pdev, mpci);
 
 	max77620_pinctrl_desc.name = dev_name(&pdev->dev);
-	max77620_pinctrl_desc.pins = max77620_pins_desc;
-	max77620_pinctrl_desc.npins = ARRAY_SIZE(max77620_pins_desc);
-	max77620_pinctrl_desc.num_custom_params =
-				ARRAY_SIZE(max77620_cfg_params);
-	max77620_pinctrl_desc.custom_params = max77620_cfg_params;
 
 	for (i = 0; i < MAX77620_PIN_NUM; ++i) {
 		mpci->fps_config[i].active_fps_src = -1;

-- 
2.45.2


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

* [PATCH 13/17] pinctrl: palmas: Move fixed assignments to 'pinctrl_desc' definition
  2025-05-28 10:40 [PATCH 00/17] pinctrl: Constify pointers to 'pinctrl_desc' and more Krzysztof Kozlowski
                   ` (11 preceding siblings ...)
  2025-05-28 10:41 ` [PATCH 12/17] pinctrl: max77620: " Krzysztof Kozlowski
@ 2025-05-28 10:41 ` Krzysztof Kozlowski
  2025-05-28 10:41 ` [PATCH 14/17] pinctrl: renesas: " Krzysztof Kozlowski
                   ` (4 subsequent siblings)
  17 siblings, 0 replies; 35+ messages in thread
From: Krzysztof Kozlowski @ 2025-05-28 10:41 UTC (permalink / raw)
  To: Linus Walleij, Basavaraj Natikar, Shyam Sundar S K,
	Andrew Jeffery, Joel Stanley, Avi Fishman, Tomer Maimon,
	Tali Perry, Patrick Venture, Nancy Yuen, Benjamin Fair,
	Jonathan Neuschäfer, Rafał Miłecki,
	Broadcom internal kernel review list, Ray Jui, Scott Branden,
	Geert Uytterhoeven, David Rhodes, Richard Fitzgerald,
	Charles Keepax, Lorenzo Bianconi, Sean Wang, Jesper Nilsson,
	Lars Persson, Manivannan Sadhasivam, Damien Le Moal,
	Vladimir Zapolskiy, Michal Simek, Emil Renner Berthing,
	Jianlong Huang, Hal Feng, Matthias Brugger,
	AngeloGioacchino Del Regno, Alexandre Belloni, Maxime Coquelin,
	Alexandre Torgue
  Cc: linux-gpio, linux-kernel, linux-aspeed, openbmc, linux-arm-kernel,
	linux-renesas-soc, linux-sound, patches, linux-mediatek,
	linux-arm-kernel, linux-riscv, linux-rtc, linux-stm32,
	Krzysztof Kozlowski

Assign 'struct pinctrl_desc' .pins and .npins members in definition to
make clear that number of pins is fixed and have less code in the probe.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 drivers/pinctrl/pinctrl-palmas.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-palmas.c b/drivers/pinctrl/pinctrl-palmas.c
index 9e272f9deb4f8c49f91d2f09c2c100018a7617f8..d69f114e46426c345d9ffe7567a326eecdd91bb5 100644
--- a/drivers/pinctrl/pinctrl-palmas.c
+++ b/drivers/pinctrl/pinctrl-palmas.c
@@ -956,6 +956,8 @@ static struct pinctrl_desc palmas_pinctrl_desc = {
 	.pmxops = &palmas_pinmux_ops,
 	.confops = &palmas_pinconf_ops,
 	.owner = THIS_MODULE,
+	.pins = palmas_pins_desc,
+	.npins = ARRAY_SIZE(palmas_pins_desc),
 };
 
 struct palmas_pinctrl_data {
@@ -1023,8 +1025,6 @@ static int palmas_pinctrl_probe(struct platform_device *pdev)
 	}
 
 	palmas_pinctrl_desc.name = dev_name(&pdev->dev);
-	palmas_pinctrl_desc.pins = palmas_pins_desc;
-	palmas_pinctrl_desc.npins = ARRAY_SIZE(palmas_pins_desc);
 	pci->pctl = devm_pinctrl_register(&pdev->dev, &palmas_pinctrl_desc,
 					  pci);
 	if (IS_ERR(pci->pctl)) {

-- 
2.45.2


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

* [PATCH 14/17] pinctrl: renesas: Move fixed assignments to 'pinctrl_desc' definition
  2025-05-28 10:40 [PATCH 00/17] pinctrl: Constify pointers to 'pinctrl_desc' and more Krzysztof Kozlowski
                   ` (12 preceding siblings ...)
  2025-05-28 10:41 ` [PATCH 13/17] pinctrl: palmas: " Krzysztof Kozlowski
@ 2025-05-28 10:41 ` Krzysztof Kozlowski
  2025-05-28 12:54   ` Geert Uytterhoeven
  2025-05-28 10:41 ` [PATCH 15/17] pinctrl: pistachio: Constify static 'pinctrl_desc' Krzysztof Kozlowski
                   ` (3 subsequent siblings)
  17 siblings, 1 reply; 35+ messages in thread
From: Krzysztof Kozlowski @ 2025-05-28 10:41 UTC (permalink / raw)
  To: Linus Walleij, Basavaraj Natikar, Shyam Sundar S K,
	Andrew Jeffery, Joel Stanley, Avi Fishman, Tomer Maimon,
	Tali Perry, Patrick Venture, Nancy Yuen, Benjamin Fair,
	Jonathan Neuschäfer, Rafał Miłecki,
	Broadcom internal kernel review list, Ray Jui, Scott Branden,
	Geert Uytterhoeven, David Rhodes, Richard Fitzgerald,
	Charles Keepax, Lorenzo Bianconi, Sean Wang, Jesper Nilsson,
	Lars Persson, Manivannan Sadhasivam, Damien Le Moal,
	Vladimir Zapolskiy, Michal Simek, Emil Renner Berthing,
	Jianlong Huang, Hal Feng, Matthias Brugger,
	AngeloGioacchino Del Regno, Alexandre Belloni, Maxime Coquelin,
	Alexandre Torgue
  Cc: linux-gpio, linux-kernel, linux-aspeed, openbmc, linux-arm-kernel,
	linux-renesas-soc, linux-sound, patches, linux-mediatek,
	linux-arm-kernel, linux-riscv, linux-rtc, linux-stm32,
	Krzysztof Kozlowski

Assign 'struct pinctrl_desc' .pins and .npins members in definition to
make clear that number of pins is fixed and have less code in the probe.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 drivers/pinctrl/renesas/pinctrl-rzn1.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pinctrl/renesas/pinctrl-rzn1.c b/drivers/pinctrl/renesas/pinctrl-rzn1.c
index d442d4f9981c908389407275522b936dbce294d3..fb874867dbfb9877b012988543ecbfd1bfb11270 100644
--- a/drivers/pinctrl/renesas/pinctrl-rzn1.c
+++ b/drivers/pinctrl/renesas/pinctrl-rzn1.c
@@ -680,6 +680,8 @@ static struct pinctrl_desc rzn1_pinctrl_desc = {
 	.pmxops = &rzn1_pmx_ops,
 	.confops = &rzn1_pinconf_ops,
 	.owner = THIS_MODULE,
+	.pins = rzn1_pins,
+	.npins = ARRAY_SIZE(rzn1_pins),
 };
 
 static int rzn1_pinctrl_parse_groups(struct device_node *np,
@@ -878,8 +880,6 @@ static int rzn1_pinctrl_probe(struct platform_device *pdev)
 
 	ipctl->dev = &pdev->dev;
 	rzn1_pinctrl_desc.name = dev_name(&pdev->dev);
-	rzn1_pinctrl_desc.pins = rzn1_pins;
-	rzn1_pinctrl_desc.npins = ARRAY_SIZE(rzn1_pins);
 
 	ret = rzn1_pinctrl_probe_dt(pdev, ipctl);
 	if (ret) {

-- 
2.45.2


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

* [PATCH 15/17] pinctrl: pistachio: Constify static 'pinctrl_desc'
  2025-05-28 10:40 [PATCH 00/17] pinctrl: Constify pointers to 'pinctrl_desc' and more Krzysztof Kozlowski
                   ` (13 preceding siblings ...)
  2025-05-28 10:41 ` [PATCH 14/17] pinctrl: renesas: " Krzysztof Kozlowski
@ 2025-05-28 10:41 ` Krzysztof Kozlowski
  2025-05-28 10:41 ` [PATCH 16/17] pinctrl: " Krzysztof Kozlowski
                   ` (2 subsequent siblings)
  17 siblings, 0 replies; 35+ messages in thread
From: Krzysztof Kozlowski @ 2025-05-28 10:41 UTC (permalink / raw)
  To: Linus Walleij, Basavaraj Natikar, Shyam Sundar S K,
	Andrew Jeffery, Joel Stanley, Avi Fishman, Tomer Maimon,
	Tali Perry, Patrick Venture, Nancy Yuen, Benjamin Fair,
	Jonathan Neuschäfer, Rafał Miłecki,
	Broadcom internal kernel review list, Ray Jui, Scott Branden,
	Geert Uytterhoeven, David Rhodes, Richard Fitzgerald,
	Charles Keepax, Lorenzo Bianconi, Sean Wang, Jesper Nilsson,
	Lars Persson, Manivannan Sadhasivam, Damien Le Moal,
	Vladimir Zapolskiy, Michal Simek, Emil Renner Berthing,
	Jianlong Huang, Hal Feng, Matthias Brugger,
	AngeloGioacchino Del Regno, Alexandre Belloni, Maxime Coquelin,
	Alexandre Torgue
  Cc: linux-gpio, linux-kernel, linux-aspeed, openbmc, linux-arm-kernel,
	linux-renesas-soc, linux-sound, patches, linux-mediatek,
	linux-arm-kernel, linux-riscv, linux-rtc, linux-stm32,
	Krzysztof Kozlowski

The local static 'struct pinctrl_desc' is not modified, so can be made
const for code safety after moving .pins and .npins assignment to
definition.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 drivers/pinctrl/pinctrl-pistachio.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-pistachio.c b/drivers/pinctrl/pinctrl-pistachio.c
index e7bf609609617d6af2f10a3df56c62e3bfe2dcd3..7f8b562c81c9cfd1ac3a0bd50018857450bdf609 100644
--- a/drivers/pinctrl/pinctrl-pistachio.c
+++ b/drivers/pinctrl/pinctrl-pistachio.c
@@ -1156,11 +1156,14 @@ static const struct pinconf_ops pistachio_pinconf_ops = {
 	.is_generic = true,
 };
 
-static struct pinctrl_desc pistachio_pinctrl_desc = {
+static const struct pinctrl_desc pistachio_pinctrl_desc = {
 	.name = "pistachio-pinctrl",
 	.pctlops = &pistachio_pinctrl_ops,
 	.pmxops = &pistachio_pinmux_ops,
 	.confops = &pistachio_pinconf_ops,
+	.pins = pistachio_pins,
+	.npins = ARRAY_SIZE(pistachio_pins),
+
 };
 
 static int pistachio_gpio_get_direction(struct gpio_chip *chip, unsigned offset)
@@ -1474,9 +1477,6 @@ static int pistachio_pinctrl_probe(struct platform_device *pdev)
 	pctl->gpio_banks = pistachio_gpio_banks;
 	pctl->nbanks = ARRAY_SIZE(pistachio_gpio_banks);
 
-	pistachio_pinctrl_desc.pins = pctl->pins;
-	pistachio_pinctrl_desc.npins = pctl->npins;
-
 	pctl->pctldev = devm_pinctrl_register(&pdev->dev, &pistachio_pinctrl_desc,
 					      pctl);
 	if (IS_ERR(pctl->pctldev)) {

-- 
2.45.2


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

* [PATCH 16/17] pinctrl: Constify static 'pinctrl_desc'
  2025-05-28 10:40 [PATCH 00/17] pinctrl: Constify pointers to 'pinctrl_desc' and more Krzysztof Kozlowski
                   ` (14 preceding siblings ...)
  2025-05-28 10:41 ` [PATCH 15/17] pinctrl: pistachio: Constify static 'pinctrl_desc' Krzysztof Kozlowski
@ 2025-05-28 10:41 ` Krzysztof Kozlowski
  2025-05-28 12:51   ` Lorenzo Bianconi
                     ` (2 more replies)
  2025-05-28 10:41 ` [PATCH 17/17] rtc: stm32: " Krzysztof Kozlowski
  2025-06-10 12:16 ` [PATCH 00/17] pinctrl: Constify pointers to 'pinctrl_desc' and more Linus Walleij
  17 siblings, 3 replies; 35+ messages in thread
From: Krzysztof Kozlowski @ 2025-05-28 10:41 UTC (permalink / raw)
  To: Linus Walleij, Basavaraj Natikar, Shyam Sundar S K,
	Andrew Jeffery, Joel Stanley, Avi Fishman, Tomer Maimon,
	Tali Perry, Patrick Venture, Nancy Yuen, Benjamin Fair,
	Jonathan Neuschäfer, Rafał Miłecki,
	Broadcom internal kernel review list, Ray Jui, Scott Branden,
	Geert Uytterhoeven, David Rhodes, Richard Fitzgerald,
	Charles Keepax, Lorenzo Bianconi, Sean Wang, Jesper Nilsson,
	Lars Persson, Manivannan Sadhasivam, Damien Le Moal,
	Vladimir Zapolskiy, Michal Simek, Emil Renner Berthing,
	Jianlong Huang, Hal Feng, Matthias Brugger,
	AngeloGioacchino Del Regno, Alexandre Belloni, Maxime Coquelin,
	Alexandre Torgue
  Cc: linux-gpio, linux-kernel, linux-aspeed, openbmc, linux-arm-kernel,
	linux-renesas-soc, linux-sound, patches, linux-mediatek,
	linux-arm-kernel, linux-riscv, linux-rtc, linux-stm32,
	Krzysztof Kozlowski

The local static 'struct pinctrl_desc' is not modified, so can be made
const for code safety.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 drivers/pinctrl/berlin/berlin.c                    | 2 +-
 drivers/pinctrl/cirrus/pinctrl-cs42l43.c           | 2 +-
 drivers/pinctrl/mediatek/pinctrl-airoha.c          | 2 +-
 drivers/pinctrl/pinctrl-artpec6.c                  | 2 +-
 drivers/pinctrl/pinctrl-bm1880.c                   | 2 +-
 drivers/pinctrl/pinctrl-k210.c                     | 2 +-
 drivers/pinctrl/pinctrl-lpc18xx.c                  | 2 +-
 drivers/pinctrl/pinctrl-mlxbf3.c                   | 2 +-
 drivers/pinctrl/pinctrl-tb10x.c                    | 2 +-
 drivers/pinctrl/pinctrl-zynq.c                     | 2 +-
 drivers/pinctrl/starfive/pinctrl-starfive-jh7100.c | 2 +-
 11 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/pinctrl/berlin/berlin.c b/drivers/pinctrl/berlin/berlin.c
index c372a2a24be4bb80b1f2475ef8512171c8e1326f..e5a35b803ce66d247c5e5ad78e6677570a1add60 100644
--- a/drivers/pinctrl/berlin/berlin.c
+++ b/drivers/pinctrl/berlin/berlin.c
@@ -283,7 +283,7 @@ static int berlin_pinctrl_build_state(struct platform_device *pdev)
 	return 0;
 }
 
-static struct pinctrl_desc berlin_pctrl_desc = {
+static const struct pinctrl_desc berlin_pctrl_desc = {
 	.name		= "berlin-pinctrl",
 	.pctlops	= &berlin_pinctrl_ops,
 	.pmxops		= &berlin_pinmux_ops,
diff --git a/drivers/pinctrl/cirrus/pinctrl-cs42l43.c b/drivers/pinctrl/cirrus/pinctrl-cs42l43.c
index 628b60ccc2b07dc77e36da8919436fa348749e0c..a90beb986f5bb707c54552e1333802943a4b04bc 100644
--- a/drivers/pinctrl/cirrus/pinctrl-cs42l43.c
+++ b/drivers/pinctrl/cirrus/pinctrl-cs42l43.c
@@ -448,7 +448,7 @@ static const struct pinconf_ops cs42l43_pin_conf_ops = {
 	.pin_config_group_set	= cs42l43_pin_config_group_set,
 };
 
-static struct pinctrl_desc cs42l43_pin_desc = {
+static const struct pinctrl_desc cs42l43_pin_desc = {
 	.name		= "cs42l43-pinctrl",
 	.owner		= THIS_MODULE,
 
diff --git a/drivers/pinctrl/mediatek/pinctrl-airoha.c b/drivers/pinctrl/mediatek/pinctrl-airoha.c
index b97b28ebb37a6ec092360f8ea404dd67e6c43eac..ccd2b512e8365b3a5af0bb223329f39119bc7078 100644
--- a/drivers/pinctrl/mediatek/pinctrl-airoha.c
+++ b/drivers/pinctrl/mediatek/pinctrl-airoha.c
@@ -2852,7 +2852,7 @@ static const struct pinctrl_ops airoha_pctlops = {
 	.dt_free_map = pinconf_generic_dt_free_map,
 };
 
-static struct pinctrl_desc airoha_pinctrl_desc = {
+static const struct pinctrl_desc airoha_pinctrl_desc = {
 	.name = KBUILD_MODNAME,
 	.owner = THIS_MODULE,
 	.pctlops = &airoha_pctlops,
diff --git a/drivers/pinctrl/pinctrl-artpec6.c b/drivers/pinctrl/pinctrl-artpec6.c
index 717f9592b28b51737e67aafc93664b1345511908..af67057128ff1e9e766b958fece9c71518c89081 100644
--- a/drivers/pinctrl/pinctrl-artpec6.c
+++ b/drivers/pinctrl/pinctrl-artpec6.c
@@ -907,7 +907,7 @@ static const struct pinconf_ops artpec6_pconf_ops = {
 	.pin_config_group_set	= artpec6_pconf_group_set,
 };
 
-static struct pinctrl_desc artpec6_desc = {
+static const struct pinctrl_desc artpec6_desc = {
 	.name	 = "artpec6-pinctrl",
 	.owner	 = THIS_MODULE,
 	.pins	 = artpec6_pins,
diff --git a/drivers/pinctrl/pinctrl-bm1880.c b/drivers/pinctrl/pinctrl-bm1880.c
index b0000fe5b31dfbcd6af6eaf0c01029f00cbd205b..387798fb09be51cabd5cb76e0d90a28b1d363050 100644
--- a/drivers/pinctrl/pinctrl-bm1880.c
+++ b/drivers/pinctrl/pinctrl-bm1880.c
@@ -1298,7 +1298,7 @@ static const struct pinmux_ops bm1880_pinmux_ops = {
 	.set_mux = bm1880_pinmux_set_mux,
 };
 
-static struct pinctrl_desc bm1880_desc = {
+static const struct pinctrl_desc bm1880_desc = {
 	.name = "bm1880_pinctrl",
 	.pins = bm1880_pins,
 	.npins = ARRAY_SIZE(bm1880_pins),
diff --git a/drivers/pinctrl/pinctrl-k210.c b/drivers/pinctrl/pinctrl-k210.c
index eddb01796a83eb86c8c5bcf6788c999e8bf2926a..66c04120c29deccf53b21cbf8705f1d10c74ace5 100644
--- a/drivers/pinctrl/pinctrl-k210.c
+++ b/drivers/pinctrl/pinctrl-k210.c
@@ -879,7 +879,7 @@ static const struct pinctrl_ops k210_pinctrl_ops = {
 	.dt_free_map = pinconf_generic_dt_free_map,
 };
 
-static struct pinctrl_desc k210_pinctrl_desc = {
+static const struct pinctrl_desc k210_pinctrl_desc = {
 	.name = "k210-pinctrl",
 	.pins = k210_pins,
 	.npins = K210_NPINS,
diff --git a/drivers/pinctrl/pinctrl-lpc18xx.c b/drivers/pinctrl/pinctrl-lpc18xx.c
index 0f5a7bed2f81b731714e3b65908df23f2ffdfd63..5e0201768323521754e7ecd27e878a81925c18a6 100644
--- a/drivers/pinctrl/pinctrl-lpc18xx.c
+++ b/drivers/pinctrl/pinctrl-lpc18xx.c
@@ -1257,7 +1257,7 @@ static const struct pinctrl_ops lpc18xx_pctl_ops = {
 	.dt_free_map		= pinctrl_utils_free_map,
 };
 
-static struct pinctrl_desc lpc18xx_scu_desc = {
+static const struct pinctrl_desc lpc18xx_scu_desc = {
 	.name = "lpc18xx/43xx-scu",
 	.pins = lpc18xx_pins,
 	.npins = ARRAY_SIZE(lpc18xx_pins),
diff --git a/drivers/pinctrl/pinctrl-mlxbf3.c b/drivers/pinctrl/pinctrl-mlxbf3.c
index ffb5dda364dc81808cfd5a168ce3f1e9f119357d..fcd9d46de89fb3e5215784109ba31b171fd15448 100644
--- a/drivers/pinctrl/pinctrl-mlxbf3.c
+++ b/drivers/pinctrl/pinctrl-mlxbf3.c
@@ -231,7 +231,7 @@ static const struct pinmux_ops mlxbf3_pmx_ops = {
 	.gpio_request_enable = mlxbf3_gpio_request_enable,
 };
 
-static struct pinctrl_desc mlxbf3_pin_desc = {
+static const struct pinctrl_desc mlxbf3_pin_desc = {
 	.name = "pinctrl-mlxbf3",
 	.pins = mlxbf3_pins,
 	.npins = ARRAY_SIZE(mlxbf3_pins),
diff --git a/drivers/pinctrl/pinctrl-tb10x.c b/drivers/pinctrl/pinctrl-tb10x.c
index d6bb8f58978df1577db24f96c2174f47962b5520..2d2e9f697ff99b4209dda8d5511f478a18b26a21 100644
--- a/drivers/pinctrl/pinctrl-tb10x.c
+++ b/drivers/pinctrl/pinctrl-tb10x.c
@@ -735,7 +735,7 @@ static const struct pinmux_ops tb10x_pinmux_ops = {
 	.set_mux = tb10x_pctl_set_mux,
 };
 
-static struct pinctrl_desc tb10x_pindesc = {
+static const struct pinctrl_desc tb10x_pindesc = {
 	.name = "TB10x",
 	.pins = tb10x_pins,
 	.npins = ARRAY_SIZE(tb10x_pins),
diff --git a/drivers/pinctrl/pinctrl-zynq.c b/drivers/pinctrl/pinctrl-zynq.c
index caa8a2ca3e681718fe213921deca8d130371b122..dcde86fed10db3e2dfebc19cb841ea7f63e74989 100644
--- a/drivers/pinctrl/pinctrl-zynq.c
+++ b/drivers/pinctrl/pinctrl-zynq.c
@@ -1143,7 +1143,7 @@ static const struct pinconf_ops zynq_pinconf_ops = {
 	.pin_config_group_set = zynq_pinconf_group_set,
 };
 
-static struct pinctrl_desc zynq_desc = {
+static const struct pinctrl_desc zynq_desc = {
 	.name = "zynq_pinctrl",
 	.pins = zynq_pins,
 	.npins = ARRAY_SIZE(zynq_pins),
diff --git a/drivers/pinctrl/starfive/pinctrl-starfive-jh7100.c b/drivers/pinctrl/starfive/pinctrl-starfive-jh7100.c
index 27f99183d994dccb92aac81ca42228bdb9225e87..aeaa0ded7c1e5ee7f9c5e4113bfd208fb844ba7d 100644
--- a/drivers/pinctrl/starfive/pinctrl-starfive-jh7100.c
+++ b/drivers/pinctrl/starfive/pinctrl-starfive-jh7100.c
@@ -898,7 +898,7 @@ static const struct pinconf_ops starfive_pinconf_ops = {
 	.is_generic = true,
 };
 
-static struct pinctrl_desc starfive_desc = {
+static const struct pinctrl_desc starfive_desc = {
 	.name = DRIVER_NAME,
 	.pins = starfive_pins,
 	.npins = ARRAY_SIZE(starfive_pins),

-- 
2.45.2


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

* [PATCH 17/17] rtc: stm32: Constify static 'pinctrl_desc'
  2025-05-28 10:40 [PATCH 00/17] pinctrl: Constify pointers to 'pinctrl_desc' and more Krzysztof Kozlowski
                   ` (15 preceding siblings ...)
  2025-05-28 10:41 ` [PATCH 16/17] pinctrl: " Krzysztof Kozlowski
@ 2025-05-28 10:41 ` Krzysztof Kozlowski
  2025-06-10 12:16 ` [PATCH 00/17] pinctrl: Constify pointers to 'pinctrl_desc' and more Linus Walleij
  17 siblings, 0 replies; 35+ messages in thread
From: Krzysztof Kozlowski @ 2025-05-28 10:41 UTC (permalink / raw)
  To: Linus Walleij, Basavaraj Natikar, Shyam Sundar S K,
	Andrew Jeffery, Joel Stanley, Avi Fishman, Tomer Maimon,
	Tali Perry, Patrick Venture, Nancy Yuen, Benjamin Fair,
	Jonathan Neuschäfer, Rafał Miłecki,
	Broadcom internal kernel review list, Ray Jui, Scott Branden,
	Geert Uytterhoeven, David Rhodes, Richard Fitzgerald,
	Charles Keepax, Lorenzo Bianconi, Sean Wang, Jesper Nilsson,
	Lars Persson, Manivannan Sadhasivam, Damien Le Moal,
	Vladimir Zapolskiy, Michal Simek, Emil Renner Berthing,
	Jianlong Huang, Hal Feng, Matthias Brugger,
	AngeloGioacchino Del Regno, Alexandre Belloni, Maxime Coquelin,
	Alexandre Torgue
  Cc: linux-gpio, linux-kernel, linux-aspeed, openbmc, linux-arm-kernel,
	linux-renesas-soc, linux-sound, patches, linux-mediatek,
	linux-arm-kernel, linux-riscv, linux-rtc, linux-stm32,
	Krzysztof Kozlowski

The local static 'struct pinctrl_desc' is not modified, so can be made
const for code safety.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

---

Patch depends on this series - const in pinctrl core. Please ack and
this should go via pinctrl tree.
---
 drivers/rtc/rtc-stm32.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/rtc/rtc-stm32.c b/drivers/rtc/rtc-stm32.c
index ef8fb88aab48a0edad19ae5872421815aa04fe46..d4ebf3eb54aa9e91c8e9f8254f571c53794192fd 100644
--- a/drivers/rtc/rtc-stm32.c
+++ b/drivers/rtc/rtc-stm32.c
@@ -393,7 +393,7 @@ static const struct pinmux_ops stm32_rtc_pinmux_ops = {
 	.strict			= true,
 };
 
-static struct pinctrl_desc stm32_rtc_pdesc = {
+static const struct pinctrl_desc stm32_rtc_pdesc = {
 	.name = DRIVER_NAME,
 	.pins = stm32_rtc_pinctrl_pins,
 	.npins = ARRAY_SIZE(stm32_rtc_pinctrl_pins),

-- 
2.45.2


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

* Re: [PATCH 01/17] pinctrl: starfive: Allow compile testing on other platforms
  2025-05-28 10:40 ` [PATCH 01/17] pinctrl: starfive: Allow compile testing on other platforms Krzysztof Kozlowski
@ 2025-05-28 12:36   ` Geert Uytterhoeven
  2025-05-28 12:51     ` Krzysztof Kozlowski
  0 siblings, 1 reply; 35+ messages in thread
From: Geert Uytterhoeven @ 2025-05-28 12:36 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Linus Walleij, Basavaraj Natikar, Shyam Sundar S K,
	Andrew Jeffery, Joel Stanley, Avi Fishman, Tomer Maimon,
	Tali Perry, Patrick Venture, Nancy Yuen, Benjamin Fair,
	Jonathan Neuschäfer, Rafał Miłecki,
	Broadcom internal kernel review list, Ray Jui, Scott Branden,
	Geert Uytterhoeven, David Rhodes, Richard Fitzgerald,
	Charles Keepax, Lorenzo Bianconi, Sean Wang, Jesper Nilsson,
	Lars Persson, Manivannan Sadhasivam, Damien Le Moal,
	Vladimir Zapolskiy, Michal Simek, Emil Renner Berthing,
	Jianlong Huang, Hal Feng, Matthias Brugger,
	AngeloGioacchino Del Regno, Alexandre Belloni, Maxime Coquelin,
	Alexandre Torgue, linux-gpio, linux-kernel, linux-aspeed, openbmc,
	linux-arm-kernel, linux-renesas-soc, linux-sound, patches,
	linux-mediatek, linux-arm-kernel, linux-riscv, linux-rtc,
	linux-stm32

Hi Krzysztof,

On Wed, 28 May 2025 at 12:41, Krzysztof Kozlowski
<krzysztof.kozlowski@linaro.org> wrote:
> Always descent to drivers/pinctrl/starfive/ because limiting it with
> SOC_STARFIVE is redundant since all of its Kconfig entries are already

... since its Makefile doesn't build anything if no Starfive-specific
pin control Kconfig options are enabled?

> have "depends on SOC_STARFIVE".  This allows compile testing on other
> architectures with allyesconfig.
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
>  drivers/pinctrl/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/pinctrl/Makefile b/drivers/pinctrl/Makefile
> index ac27e88677d14f1c697e0d0be9f295c746556f4d..dcede70b25660833a158c298d1269d6ecea9dd8b 100644
> --- a/drivers/pinctrl/Makefile
> +++ b/drivers/pinctrl/Makefile
> @@ -82,7 +82,7 @@ obj-y                         += sophgo/
>  obj-y                          += spacemit/
>  obj-$(CONFIG_PINCTRL_SPEAR)    += spear/
>  obj-y                          += sprd/
> -obj-$(CONFIG_SOC_STARFIVE)     += starfive/
> +obj-y                          += starfive/
>  obj-$(CONFIG_PINCTRL_STM32)    += stm32/
>  obj-y                          += sunplus/
>  obj-$(CONFIG_PINCTRL_SUNXI)    += sunxi/

The actual change LGTM, so
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH 04/17] pinctrl: Constify pointers to 'pinctrl_desc'
  2025-05-28 10:41 ` [PATCH 04/17] pinctrl: " Krzysztof Kozlowski
@ 2025-05-28 12:47   ` Geert Uytterhoeven
  0 siblings, 0 replies; 35+ messages in thread
From: Geert Uytterhoeven @ 2025-05-28 12:47 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Linus Walleij, Basavaraj Natikar, Shyam Sundar S K,
	Andrew Jeffery, Joel Stanley, Avi Fishman, Tomer Maimon,
	Tali Perry, Patrick Venture, Nancy Yuen, Benjamin Fair,
	Jonathan Neuschäfer, Rafał Miłecki,
	Broadcom internal kernel review list, Ray Jui, Scott Branden,
	David Rhodes, Richard Fitzgerald, Charles Keepax,
	Lorenzo Bianconi, Sean Wang, Jesper Nilsson, Lars Persson,
	Manivannan Sadhasivam, Damien Le Moal, Vladimir Zapolskiy,
	Michal Simek, Emil Renner Berthing, Jianlong Huang, Hal Feng,
	Matthias Brugger, AngeloGioacchino Del Regno, Alexandre Belloni,
	Maxime Coquelin, Alexandre Torgue, linux-gpio, linux-kernel,
	linux-aspeed, openbmc, linux-arm-kernel, linux-renesas-soc,
	linux-sound, patches, linux-mediatek, linux-arm-kernel,
	linux-riscv, linux-rtc, linux-stm32

On Wed, 28 May 2025 at 12:41, Krzysztof Kozlowski
<krzysztof.kozlowski@linaro.org> wrote:
> Pin controller core code only stores the pointer to
> 'struct pinctrl_desc' and does not modify it anywhere.  The pointer can
> be changed to pointer to const which makes the code safer, explicit and
> later allows constifying 'pinctrl_desc' allocations in individual
> drivers.
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH 01/17] pinctrl: starfive: Allow compile testing on other platforms
  2025-05-28 12:36   ` Geert Uytterhoeven
@ 2025-05-28 12:51     ` Krzysztof Kozlowski
  0 siblings, 0 replies; 35+ messages in thread
From: Krzysztof Kozlowski @ 2025-05-28 12:51 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Linus Walleij, Basavaraj Natikar, Shyam Sundar S K,
	Andrew Jeffery, Joel Stanley, Avi Fishman, Tomer Maimon,
	Tali Perry, Patrick Venture, Nancy Yuen, Benjamin Fair,
	Jonathan Neuschäfer, Rafał Miłecki,
	Broadcom internal kernel review list, Ray Jui, Scott Branden,
	Geert Uytterhoeven, David Rhodes, Richard Fitzgerald,
	Charles Keepax, Lorenzo Bianconi, Sean Wang, Jesper Nilsson,
	Lars Persson, Manivannan Sadhasivam, Damien Le Moal,
	Vladimir Zapolskiy, Michal Simek, Emil Renner Berthing,
	Jianlong Huang, Hal Feng, Matthias Brugger,
	AngeloGioacchino Del Regno, Alexandre Belloni, Maxime Coquelin,
	Alexandre Torgue, linux-gpio, linux-kernel, linux-aspeed, openbmc,
	linux-arm-kernel, linux-renesas-soc, linux-sound, patches,
	linux-mediatek, linux-arm-kernel, linux-riscv, linux-rtc,
	linux-stm32

On 28/05/2025 14:36, Geert Uytterhoeven wrote:
> Hi Krzysztof,
> 
> On Wed, 28 May 2025 at 12:41, Krzysztof Kozlowski
> <krzysztof.kozlowski@linaro.org> wrote:
>> Always descent to drivers/pinctrl/starfive/ because limiting it with
>> SOC_STARFIVE is redundant since all of its Kconfig entries are already
> 
> ... since its Makefile doesn't build anything if no Starfive-specific
> pin control Kconfig options are enabled?

Yes, that's better. Thank you.

> 
>> have "depends on SOC_STARFIVE".  This allows compile testing on other
>> architectures with allyesconfig.
>>
>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>> ---
>>  drivers/pinctrl/Makefile | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/pinctrl/Makefile b/drivers/pinctrl/Makefile
>> index ac27e88677d14f1c697e0d0be9f295c746556f4d..dcede70b25660833a158c298d1269d6ecea9dd8b 100644
>> --- a/drivers/pinctrl/Makefile
>> +++ b/drivers/pinctrl/Makefile
>> @@ -82,7 +82,7 @@ obj-y                         += sophgo/
>>  obj-y                          += spacemit/
>>  obj-$(CONFIG_PINCTRL_SPEAR)    += spear/
>>  obj-y                          += sprd/
>> -obj-$(CONFIG_SOC_STARFIVE)     += starfive/
>> +obj-y                          += starfive/
>>  obj-$(CONFIG_PINCTRL_STM32)    += stm32/
>>  obj-y                          += sunplus/
>>  obj-$(CONFIG_PINCTRL_SUNXI)    += sunxi/
> 
> The actual change LGTM, so
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> 
Ack

Best regards,
Krzysztof

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

* Re: [PATCH 16/17] pinctrl: Constify static 'pinctrl_desc'
  2025-05-28 10:41 ` [PATCH 16/17] pinctrl: " Krzysztof Kozlowski
@ 2025-05-28 12:51   ` Lorenzo Bianconi
  2025-05-28 16:41   ` Charles Keepax
  2025-06-03  9:40   ` Jesper Nilsson
  2 siblings, 0 replies; 35+ messages in thread
From: Lorenzo Bianconi @ 2025-05-28 12:51 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Linus Walleij, Basavaraj Natikar, Shyam Sundar S K,
	Andrew Jeffery, Joel Stanley, Avi Fishman, Tomer Maimon,
	Tali Perry, Patrick Venture, Nancy Yuen, Benjamin Fair,
	Jonathan Neuschäfer, Rafał Miłecki,
	Broadcom internal kernel review list, Ray Jui, Scott Branden,
	Geert Uytterhoeven, David Rhodes, Richard Fitzgerald,
	Charles Keepax, Sean Wang, Jesper Nilsson, Lars Persson,
	Manivannan Sadhasivam, Damien Le Moal, Vladimir Zapolskiy,
	Michal Simek, Emil Renner Berthing, Jianlong Huang, Hal Feng,
	Matthias Brugger, AngeloGioacchino Del Regno, Alexandre Belloni,
	Maxime Coquelin, Alexandre Torgue, linux-gpio, linux-kernel,
	linux-aspeed, openbmc, linux-arm-kernel, linux-renesas-soc,
	linux-sound, patches, linux-mediatek, linux-arm-kernel,
	linux-riscv, linux-rtc, linux-stm32

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

> The local static 'struct pinctrl_desc' is not modified, so can be made
> const for code safety.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

For airoha bits:

Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>

> ---
>  drivers/pinctrl/berlin/berlin.c                    | 2 +-
>  drivers/pinctrl/cirrus/pinctrl-cs42l43.c           | 2 +-
>  drivers/pinctrl/mediatek/pinctrl-airoha.c          | 2 +-
>  drivers/pinctrl/pinctrl-artpec6.c                  | 2 +-
>  drivers/pinctrl/pinctrl-bm1880.c                   | 2 +-
>  drivers/pinctrl/pinctrl-k210.c                     | 2 +-
>  drivers/pinctrl/pinctrl-lpc18xx.c                  | 2 +-
>  drivers/pinctrl/pinctrl-mlxbf3.c                   | 2 +-
>  drivers/pinctrl/pinctrl-tb10x.c                    | 2 +-
>  drivers/pinctrl/pinctrl-zynq.c                     | 2 +-
>  drivers/pinctrl/starfive/pinctrl-starfive-jh7100.c | 2 +-
>  11 files changed, 11 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/pinctrl/berlin/berlin.c b/drivers/pinctrl/berlin/berlin.c
> index c372a2a24be4bb80b1f2475ef8512171c8e1326f..e5a35b803ce66d247c5e5ad78e6677570a1add60 100644
> --- a/drivers/pinctrl/berlin/berlin.c
> +++ b/drivers/pinctrl/berlin/berlin.c
> @@ -283,7 +283,7 @@ static int berlin_pinctrl_build_state(struct platform_device *pdev)
>  	return 0;
>  }
>  
> -static struct pinctrl_desc berlin_pctrl_desc = {
> +static const struct pinctrl_desc berlin_pctrl_desc = {
>  	.name		= "berlin-pinctrl",
>  	.pctlops	= &berlin_pinctrl_ops,
>  	.pmxops		= &berlin_pinmux_ops,
> diff --git a/drivers/pinctrl/cirrus/pinctrl-cs42l43.c b/drivers/pinctrl/cirrus/pinctrl-cs42l43.c
> index 628b60ccc2b07dc77e36da8919436fa348749e0c..a90beb986f5bb707c54552e1333802943a4b04bc 100644
> --- a/drivers/pinctrl/cirrus/pinctrl-cs42l43.c
> +++ b/drivers/pinctrl/cirrus/pinctrl-cs42l43.c
> @@ -448,7 +448,7 @@ static const struct pinconf_ops cs42l43_pin_conf_ops = {
>  	.pin_config_group_set	= cs42l43_pin_config_group_set,
>  };
>  
> -static struct pinctrl_desc cs42l43_pin_desc = {
> +static const struct pinctrl_desc cs42l43_pin_desc = {
>  	.name		= "cs42l43-pinctrl",
>  	.owner		= THIS_MODULE,
>  
> diff --git a/drivers/pinctrl/mediatek/pinctrl-airoha.c b/drivers/pinctrl/mediatek/pinctrl-airoha.c
> index b97b28ebb37a6ec092360f8ea404dd67e6c43eac..ccd2b512e8365b3a5af0bb223329f39119bc7078 100644
> --- a/drivers/pinctrl/mediatek/pinctrl-airoha.c
> +++ b/drivers/pinctrl/mediatek/pinctrl-airoha.c
> @@ -2852,7 +2852,7 @@ static const struct pinctrl_ops airoha_pctlops = {
>  	.dt_free_map = pinconf_generic_dt_free_map,
>  };
>  
> -static struct pinctrl_desc airoha_pinctrl_desc = {
> +static const struct pinctrl_desc airoha_pinctrl_desc = {
>  	.name = KBUILD_MODNAME,
>  	.owner = THIS_MODULE,
>  	.pctlops = &airoha_pctlops,
> diff --git a/drivers/pinctrl/pinctrl-artpec6.c b/drivers/pinctrl/pinctrl-artpec6.c
> index 717f9592b28b51737e67aafc93664b1345511908..af67057128ff1e9e766b958fece9c71518c89081 100644
> --- a/drivers/pinctrl/pinctrl-artpec6.c
> +++ b/drivers/pinctrl/pinctrl-artpec6.c
> @@ -907,7 +907,7 @@ static const struct pinconf_ops artpec6_pconf_ops = {
>  	.pin_config_group_set	= artpec6_pconf_group_set,
>  };
>  
> -static struct pinctrl_desc artpec6_desc = {
> +static const struct pinctrl_desc artpec6_desc = {
>  	.name	 = "artpec6-pinctrl",
>  	.owner	 = THIS_MODULE,
>  	.pins	 = artpec6_pins,
> diff --git a/drivers/pinctrl/pinctrl-bm1880.c b/drivers/pinctrl/pinctrl-bm1880.c
> index b0000fe5b31dfbcd6af6eaf0c01029f00cbd205b..387798fb09be51cabd5cb76e0d90a28b1d363050 100644
> --- a/drivers/pinctrl/pinctrl-bm1880.c
> +++ b/drivers/pinctrl/pinctrl-bm1880.c
> @@ -1298,7 +1298,7 @@ static const struct pinmux_ops bm1880_pinmux_ops = {
>  	.set_mux = bm1880_pinmux_set_mux,
>  };
>  
> -static struct pinctrl_desc bm1880_desc = {
> +static const struct pinctrl_desc bm1880_desc = {
>  	.name = "bm1880_pinctrl",
>  	.pins = bm1880_pins,
>  	.npins = ARRAY_SIZE(bm1880_pins),
> diff --git a/drivers/pinctrl/pinctrl-k210.c b/drivers/pinctrl/pinctrl-k210.c
> index eddb01796a83eb86c8c5bcf6788c999e8bf2926a..66c04120c29deccf53b21cbf8705f1d10c74ace5 100644
> --- a/drivers/pinctrl/pinctrl-k210.c
> +++ b/drivers/pinctrl/pinctrl-k210.c
> @@ -879,7 +879,7 @@ static const struct pinctrl_ops k210_pinctrl_ops = {
>  	.dt_free_map = pinconf_generic_dt_free_map,
>  };
>  
> -static struct pinctrl_desc k210_pinctrl_desc = {
> +static const struct pinctrl_desc k210_pinctrl_desc = {
>  	.name = "k210-pinctrl",
>  	.pins = k210_pins,
>  	.npins = K210_NPINS,
> diff --git a/drivers/pinctrl/pinctrl-lpc18xx.c b/drivers/pinctrl/pinctrl-lpc18xx.c
> index 0f5a7bed2f81b731714e3b65908df23f2ffdfd63..5e0201768323521754e7ecd27e878a81925c18a6 100644
> --- a/drivers/pinctrl/pinctrl-lpc18xx.c
> +++ b/drivers/pinctrl/pinctrl-lpc18xx.c
> @@ -1257,7 +1257,7 @@ static const struct pinctrl_ops lpc18xx_pctl_ops = {
>  	.dt_free_map		= pinctrl_utils_free_map,
>  };
>  
> -static struct pinctrl_desc lpc18xx_scu_desc = {
> +static const struct pinctrl_desc lpc18xx_scu_desc = {
>  	.name = "lpc18xx/43xx-scu",
>  	.pins = lpc18xx_pins,
>  	.npins = ARRAY_SIZE(lpc18xx_pins),
> diff --git a/drivers/pinctrl/pinctrl-mlxbf3.c b/drivers/pinctrl/pinctrl-mlxbf3.c
> index ffb5dda364dc81808cfd5a168ce3f1e9f119357d..fcd9d46de89fb3e5215784109ba31b171fd15448 100644
> --- a/drivers/pinctrl/pinctrl-mlxbf3.c
> +++ b/drivers/pinctrl/pinctrl-mlxbf3.c
> @@ -231,7 +231,7 @@ static const struct pinmux_ops mlxbf3_pmx_ops = {
>  	.gpio_request_enable = mlxbf3_gpio_request_enable,
>  };
>  
> -static struct pinctrl_desc mlxbf3_pin_desc = {
> +static const struct pinctrl_desc mlxbf3_pin_desc = {
>  	.name = "pinctrl-mlxbf3",
>  	.pins = mlxbf3_pins,
>  	.npins = ARRAY_SIZE(mlxbf3_pins),
> diff --git a/drivers/pinctrl/pinctrl-tb10x.c b/drivers/pinctrl/pinctrl-tb10x.c
> index d6bb8f58978df1577db24f96c2174f47962b5520..2d2e9f697ff99b4209dda8d5511f478a18b26a21 100644
> --- a/drivers/pinctrl/pinctrl-tb10x.c
> +++ b/drivers/pinctrl/pinctrl-tb10x.c
> @@ -735,7 +735,7 @@ static const struct pinmux_ops tb10x_pinmux_ops = {
>  	.set_mux = tb10x_pctl_set_mux,
>  };
>  
> -static struct pinctrl_desc tb10x_pindesc = {
> +static const struct pinctrl_desc tb10x_pindesc = {
>  	.name = "TB10x",
>  	.pins = tb10x_pins,
>  	.npins = ARRAY_SIZE(tb10x_pins),
> diff --git a/drivers/pinctrl/pinctrl-zynq.c b/drivers/pinctrl/pinctrl-zynq.c
> index caa8a2ca3e681718fe213921deca8d130371b122..dcde86fed10db3e2dfebc19cb841ea7f63e74989 100644
> --- a/drivers/pinctrl/pinctrl-zynq.c
> +++ b/drivers/pinctrl/pinctrl-zynq.c
> @@ -1143,7 +1143,7 @@ static const struct pinconf_ops zynq_pinconf_ops = {
>  	.pin_config_group_set = zynq_pinconf_group_set,
>  };
>  
> -static struct pinctrl_desc zynq_desc = {
> +static const struct pinctrl_desc zynq_desc = {
>  	.name = "zynq_pinctrl",
>  	.pins = zynq_pins,
>  	.npins = ARRAY_SIZE(zynq_pins),
> diff --git a/drivers/pinctrl/starfive/pinctrl-starfive-jh7100.c b/drivers/pinctrl/starfive/pinctrl-starfive-jh7100.c
> index 27f99183d994dccb92aac81ca42228bdb9225e87..aeaa0ded7c1e5ee7f9c5e4113bfd208fb844ba7d 100644
> --- a/drivers/pinctrl/starfive/pinctrl-starfive-jh7100.c
> +++ b/drivers/pinctrl/starfive/pinctrl-starfive-jh7100.c
> @@ -898,7 +898,7 @@ static const struct pinconf_ops starfive_pinconf_ops = {
>  	.is_generic = true,
>  };
>  
> -static struct pinctrl_desc starfive_desc = {
> +static const struct pinctrl_desc starfive_desc = {
>  	.name = DRIVER_NAME,
>  	.pins = starfive_pins,
>  	.npins = ARRAY_SIZE(starfive_pins),
> 
> -- 
> 2.45.2
> 

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

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

* Re: [PATCH 14/17] pinctrl: renesas: Move fixed assignments to 'pinctrl_desc' definition
  2025-05-28 10:41 ` [PATCH 14/17] pinctrl: renesas: " Krzysztof Kozlowski
@ 2025-05-28 12:54   ` Geert Uytterhoeven
  2025-05-28 17:55     ` Krzysztof Kozlowski
  0 siblings, 1 reply; 35+ messages in thread
From: Geert Uytterhoeven @ 2025-05-28 12:54 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Linus Walleij, Basavaraj Natikar, Shyam Sundar S K,
	Andrew Jeffery, Joel Stanley, Avi Fishman, Tomer Maimon,
	Tali Perry, Patrick Venture, Nancy Yuen, Benjamin Fair,
	Jonathan Neuschäfer, Rafał Miłecki,
	Broadcom internal kernel review list, Ray Jui, Scott Branden,
	Geert Uytterhoeven, David Rhodes, Richard Fitzgerald,
	Charles Keepax, Lorenzo Bianconi, Sean Wang, Jesper Nilsson,
	Lars Persson, Manivannan Sadhasivam, Damien Le Moal,
	Vladimir Zapolskiy, Michal Simek, Emil Renner Berthing,
	Jianlong Huang, Hal Feng, Matthias Brugger,
	AngeloGioacchino Del Regno, Alexandre Belloni, Maxime Coquelin,
	Alexandre Torgue, linux-gpio, linux-kernel, linux-aspeed, openbmc,
	linux-arm-kernel, linux-renesas-soc, linux-sound, patches,
	linux-mediatek, linux-arm-kernel, linux-riscv, linux-rtc,
	linux-stm32

Hi Krzysztof,

On Wed, 28 May 2025 at 12:42, Krzysztof Kozlowski
<krzysztof.kozlowski@linaro.org> wrote:
> Assign 'struct pinctrl_desc' .pins and .npins members in definition to
> make clear that number of pins is fixed and have less code in the probe.
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>

> --- a/drivers/pinctrl/renesas/pinctrl-rzn1.c
> +++ b/drivers/pinctrl/renesas/pinctrl-rzn1.c
> @@ -680,6 +680,8 @@ static struct pinctrl_desc rzn1_pinctrl_desc = {

This structure could be made const...

>         .pmxops = &rzn1_pmx_ops,
>         .confops = &rzn1_pinconf_ops,
>         .owner = THIS_MODULE,
> +       .pins = rzn1_pins,
> +       .npins = ARRAY_SIZE(rzn1_pins),
>  };
>
>  static int rzn1_pinctrl_parse_groups(struct device_node *np,
> @@ -878,8 +880,6 @@ static int rzn1_pinctrl_probe(struct platform_device *pdev)
>
>         ipctl->dev = &pdev->dev;
>         rzn1_pinctrl_desc.name = dev_name(&pdev->dev);

... if you would replace this assignment by a hardcoded name
like "pinctrl-rzn1".

> -       rzn1_pinctrl_desc.pins = rzn1_pins;
> -       rzn1_pinctrl_desc.npins = ARRAY_SIZE(rzn1_pins);
>
>         ret = rzn1_pinctrl_probe_dt(pdev, ipctl);
>         if (ret) {

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH 16/17] pinctrl: Constify static 'pinctrl_desc'
  2025-05-28 10:41 ` [PATCH 16/17] pinctrl: " Krzysztof Kozlowski
  2025-05-28 12:51   ` Lorenzo Bianconi
@ 2025-05-28 16:41   ` Charles Keepax
  2025-06-03  9:40   ` Jesper Nilsson
  2 siblings, 0 replies; 35+ messages in thread
From: Charles Keepax @ 2025-05-28 16:41 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Linus Walleij, Basavaraj Natikar, Shyam Sundar S K,
	Andrew Jeffery, Joel Stanley, Avi Fishman, Tomer Maimon,
	Tali Perry, Patrick Venture, Nancy Yuen, Benjamin Fair,
	Jonathan Neuschäfer, Rafał Miłecki,
	Broadcom internal kernel review list, Ray Jui, Scott Branden,
	Geert Uytterhoeven, David Rhodes, Richard Fitzgerald,
	Lorenzo Bianconi, Sean Wang, Jesper Nilsson, Lars Persson,
	Manivannan Sadhasivam, Damien Le Moal, Vladimir Zapolskiy,
	Michal Simek, Emil Renner Berthing, Jianlong Huang, Hal Feng,
	Matthias Brugger, AngeloGioacchino Del Regno, Alexandre Belloni,
	Maxime Coquelin, Alexandre Torgue, linux-gpio, linux-kernel,
	linux-aspeed, openbmc, linux-arm-kernel, linux-renesas-soc,
	linux-sound, patches, linux-mediatek, linux-arm-kernel,
	linux-riscv, linux-rtc, linux-stm32

On Wed, May 28, 2025 at 12:41:12PM +0200, Krzysztof Kozlowski wrote:
> The local static 'struct pinctrl_desc' is not modified, so can be made
> const for code safety.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---

For the cs42l43:

Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>

Thanks,
Charles

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

* Re: [PATCH 07/17] pinctrl: bcm: Constify static 'pinctrl_desc'
  2025-05-28 10:41 ` [PATCH 07/17] pinctrl: bcm: " Krzysztof Kozlowski
@ 2025-05-28 16:45   ` Florian Fainelli
  0 siblings, 0 replies; 35+ messages in thread
From: Florian Fainelli @ 2025-05-28 16:45 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Linus Walleij, Basavaraj Natikar,
	Shyam Sundar S K, Andrew Jeffery, Joel Stanley, Avi Fishman,
	Tomer Maimon, Tali Perry, Patrick Venture, Nancy Yuen,
	Benjamin Fair, Jonathan Neuschäfer, Rafał Miłecki,
	Broadcom internal kernel review list, Ray Jui, Scott Branden,
	Geert Uytterhoeven, David Rhodes, Richard Fitzgerald,
	Charles Keepax, Lorenzo Bianconi, Sean Wang, Jesper Nilsson,
	Lars Persson, Manivannan Sadhasivam, Damien Le Moal,
	Vladimir Zapolskiy, Michal Simek, Emil Renner Berthing,
	Jianlong Huang, Hal Feng, Matthias Brugger,
	AngeloGioacchino Del Regno, Alexandre Belloni, Maxime Coquelin,
	Alexandre Torgue
  Cc: linux-gpio, linux-kernel, linux-aspeed, openbmc, linux-arm-kernel,
	linux-renesas-soc, linux-sound, patches, linux-mediatek,
	linux-arm-kernel, linux-riscv, linux-rtc, linux-stm32

On 5/28/25 03:41, Krzysztof Kozlowski wrote:
> The local static 'struct pinctrl_desc' is not modified, so can be made
> const for code safety.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
-- 
Florian

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

* Re: [PATCH 08/17] pinctrl: bcm: cygnus-mux: Move fixed assignments to 'pinctrl_desc' definition
  2025-05-28 10:41 ` [PATCH 08/17] pinctrl: bcm: cygnus-mux: Move fixed assignments to 'pinctrl_desc' definition Krzysztof Kozlowski
@ 2025-05-28 16:46   ` Florian Fainelli
  0 siblings, 0 replies; 35+ messages in thread
From: Florian Fainelli @ 2025-05-28 16:46 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Linus Walleij, Basavaraj Natikar,
	Shyam Sundar S K, Andrew Jeffery, Joel Stanley, Avi Fishman,
	Tomer Maimon, Tali Perry, Patrick Venture, Nancy Yuen,
	Benjamin Fair, Jonathan Neuschäfer, Rafał Miłecki,
	Broadcom internal kernel review list, Ray Jui, Scott Branden,
	Geert Uytterhoeven, David Rhodes, Richard Fitzgerald,
	Charles Keepax, Lorenzo Bianconi, Sean Wang, Jesper Nilsson,
	Lars Persson, Manivannan Sadhasivam, Damien Le Moal,
	Vladimir Zapolskiy, Michal Simek, Emil Renner Berthing,
	Jianlong Huang, Hal Feng, Matthias Brugger,
	AngeloGioacchino Del Regno, Alexandre Belloni, Maxime Coquelin,
	Alexandre Torgue
  Cc: linux-gpio, linux-kernel, linux-aspeed, openbmc, linux-arm-kernel,
	linux-renesas-soc, linux-sound, patches, linux-mediatek,
	linux-arm-kernel, linux-riscv, linux-rtc, linux-stm32

On 5/28/25 03:41, Krzysztof Kozlowski wrote:
> Assign 'struct pinctrl_desc' .npins member in definition to make clear
> that number of pins is fixed and have less code in the probe.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
-- 
Florian

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

* Re: [PATCH 09/17] pinctrl: bcm: cygnus-ns2: Move fixed assignments to 'pinctrl_desc' definition
  2025-05-28 10:41 ` [PATCH 09/17] pinctrl: bcm: cygnus-ns2: " Krzysztof Kozlowski
@ 2025-05-28 16:46   ` Florian Fainelli
  0 siblings, 0 replies; 35+ messages in thread
From: Florian Fainelli @ 2025-05-28 16:46 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Linus Walleij, Basavaraj Natikar,
	Shyam Sundar S K, Andrew Jeffery, Joel Stanley, Avi Fishman,
	Tomer Maimon, Tali Perry, Patrick Venture, Nancy Yuen,
	Benjamin Fair, Jonathan Neuschäfer, Rafał Miłecki,
	Broadcom internal kernel review list, Ray Jui, Scott Branden,
	Geert Uytterhoeven, David Rhodes, Richard Fitzgerald,
	Charles Keepax, Lorenzo Bianconi, Sean Wang, Jesper Nilsson,
	Lars Persson, Manivannan Sadhasivam, Damien Le Moal,
	Vladimir Zapolskiy, Michal Simek, Emil Renner Berthing,
	Jianlong Huang, Hal Feng, Matthias Brugger,
	AngeloGioacchino Del Regno, Alexandre Belloni, Maxime Coquelin,
	Alexandre Torgue
  Cc: linux-gpio, linux-kernel, linux-aspeed, openbmc, linux-arm-kernel,
	linux-renesas-soc, linux-sound, patches, linux-mediatek,
	linux-arm-kernel, linux-riscv, linux-rtc, linux-stm32

On 5/28/25 03:41, Krzysztof Kozlowski wrote:
> Assign 'struct pinctrl_desc' .npins member in definition to make clear
> that number of pins is fixed and have less code in the probe.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
-- 
Florian

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

* Re: [PATCH 10/17] pinctrl: bcm: cygnus-nsp: Move fixed assignments to 'pinctrl_desc' definition
  2025-05-28 10:41 ` [PATCH 10/17] pinctrl: bcm: cygnus-nsp: " Krzysztof Kozlowski
@ 2025-05-28 16:46   ` Florian Fainelli
  0 siblings, 0 replies; 35+ messages in thread
From: Florian Fainelli @ 2025-05-28 16:46 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Linus Walleij, Basavaraj Natikar,
	Shyam Sundar S K, Andrew Jeffery, Joel Stanley, Avi Fishman,
	Tomer Maimon, Tali Perry, Patrick Venture, Nancy Yuen,
	Benjamin Fair, Jonathan Neuschäfer, Rafał Miłecki,
	Broadcom internal kernel review list, Ray Jui, Scott Branden,
	Geert Uytterhoeven, David Rhodes, Richard Fitzgerald,
	Charles Keepax, Lorenzo Bianconi, Sean Wang, Jesper Nilsson,
	Lars Persson, Manivannan Sadhasivam, Damien Le Moal,
	Vladimir Zapolskiy, Michal Simek, Emil Renner Berthing,
	Jianlong Huang, Hal Feng, Matthias Brugger,
	AngeloGioacchino Del Regno, Alexandre Belloni, Maxime Coquelin,
	Alexandre Torgue
  Cc: linux-gpio, linux-kernel, linux-aspeed, openbmc, linux-arm-kernel,
	linux-renesas-soc, linux-sound, patches, linux-mediatek,
	linux-arm-kernel, linux-riscv, linux-rtc, linux-stm32

On 5/28/25 03:41, Krzysztof Kozlowski wrote:
> Assign 'struct pinctrl_desc' .npins member in definition to make clear
> that number of pins is fixed and have less code in the probe.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
-- 
Florian

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

* Re: [PATCH 14/17] pinctrl: renesas: Move fixed assignments to 'pinctrl_desc' definition
  2025-05-28 12:54   ` Geert Uytterhoeven
@ 2025-05-28 17:55     ` Krzysztof Kozlowski
  2025-05-30  8:06       ` Geert Uytterhoeven
  0 siblings, 1 reply; 35+ messages in thread
From: Krzysztof Kozlowski @ 2025-05-28 17:55 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Linus Walleij, Basavaraj Natikar, Shyam Sundar S K,
	Andrew Jeffery, Joel Stanley, Avi Fishman, Tomer Maimon,
	Tali Perry, Patrick Venture, Nancy Yuen, Benjamin Fair,
	Jonathan Neuschäfer, Rafał Miłecki,
	Broadcom internal kernel review list, Ray Jui, Scott Branden,
	Geert Uytterhoeven, David Rhodes, Richard Fitzgerald,
	Charles Keepax, Lorenzo Bianconi, Sean Wang, Jesper Nilsson,
	Lars Persson, Manivannan Sadhasivam, Damien Le Moal,
	Vladimir Zapolskiy, Michal Simek, Emil Renner Berthing,
	Jianlong Huang, Hal Feng, Matthias Brugger,
	AngeloGioacchino Del Regno, Alexandre Belloni, Maxime Coquelin,
	Alexandre Torgue, linux-gpio, linux-kernel, linux-aspeed, openbmc,
	linux-arm-kernel, linux-renesas-soc, linux-sound, patches,
	linux-mediatek, linux-arm-kernel, linux-riscv, linux-rtc,
	linux-stm32

On 28/05/2025 14:54, Geert Uytterhoeven wrote:
>>         .pmxops = &rzn1_pmx_ops,
>>         .confops = &rzn1_pinconf_ops,
>>         .owner = THIS_MODULE,
>> +       .pins = rzn1_pins,
>> +       .npins = ARRAY_SIZE(rzn1_pins),
>>  };
>>
>>  static int rzn1_pinctrl_parse_groups(struct device_node *np,
>> @@ -878,8 +880,6 @@ static int rzn1_pinctrl_probe(struct platform_device *pdev)
>>
>>         ipctl->dev = &pdev->dev;
>>         rzn1_pinctrl_desc.name = dev_name(&pdev->dev);
> 
> ... if you would replace this assignment by a hardcoded name
> like "pinctrl-rzn1".

I saw it, but this would not be equivalent. dev_name includes platform
bus id, e.g. pinctrl-rzn1.0 which might matter here - conflict of names.
Are you sure this would work fine?

Best regards,
Krzysztof

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

* Re: [PATCH 05/17] pinctrl: aspeed: Constify static 'pinctrl_desc'
  2025-05-28 10:41 ` [PATCH 05/17] pinctrl: aspeed: Constify static 'pinctrl_desc' Krzysztof Kozlowski
@ 2025-05-29  0:39   ` Andrew Jeffery
  0 siblings, 0 replies; 35+ messages in thread
From: Andrew Jeffery @ 2025-05-29  0:39 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Linus Walleij, Basavaraj Natikar,
	Shyam Sundar S K, Joel Stanley, Avi Fishman, Tomer Maimon,
	Tali Perry, Patrick Venture, Nancy Yuen, Benjamin Fair,
	Jonathan Neuschäfer, Rafał Miłecki,
	Broadcom internal kernel review list, Ray Jui, Scott Branden,
	Geert Uytterhoeven, David Rhodes, Richard Fitzgerald,
	Charles Keepax, Lorenzo Bianconi, Sean Wang, Jesper Nilsson,
	Lars Persson, Manivannan Sadhasivam, Damien Le Moal,
	Vladimir Zapolskiy, Michal Simek, Emil Renner Berthing,
	Jianlong Huang, Hal Feng, Matthias Brugger,
	AngeloGioacchino Del Regno, Alexandre Belloni, Maxime Coquelin,
	Alexandre Torgue
  Cc: linux-gpio, linux-kernel, linux-aspeed, openbmc, linux-arm-kernel,
	linux-renesas-soc, linux-sound, patches, linux-mediatek,
	linux-arm-kernel, linux-riscv, linux-rtc, linux-stm32

On Wed, 2025-05-28 at 12:41 +0200, Krzysztof Kozlowski wrote:
> The local static 'struct pinctrl_desc' is not modified, so can be made
> const for code safety.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Reviewed-by: Andrew Jeffery <andrew@codeconstruct.com.au>

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

* Re: [PATCH 02/17] pinctrl: Allow compile testing for K210, TB10X and ZYNQ
  2025-05-28 10:40 ` [PATCH 02/17] pinctrl: Allow compile testing for K210, TB10X and ZYNQ Krzysztof Kozlowski
@ 2025-05-29  6:26   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 35+ messages in thread
From: Krzysztof Kozlowski @ 2025-05-29  6:26 UTC (permalink / raw)
  To: Linus Walleij, Basavaraj Natikar, Shyam Sundar S K,
	Andrew Jeffery, Joel Stanley, Avi Fishman, Tomer Maimon,
	Tali Perry, Patrick Venture, Nancy Yuen, Benjamin Fair,
	Jonathan Neuschäfer, Rafał Miłecki,
	Broadcom internal kernel review list, Ray Jui, Scott Branden,
	Geert Uytterhoeven, David Rhodes, Richard Fitzgerald,
	Charles Keepax, Lorenzo Bianconi, Sean Wang, Jesper Nilsson,
	Lars Persson, Manivannan Sadhasivam, Damien Le Moal,
	Vladimir Zapolskiy, Michal Simek, Emil Renner Berthing,
	Jianlong Huang, Hal Feng, Matthias Brugger,
	AngeloGioacchino Del Regno, Alexandre Belloni, Maxime Coquelin,
	Alexandre Torgue
  Cc: linux-gpio, linux-kernel, linux-aspeed, openbmc, linux-arm-kernel,
	linux-renesas-soc, linux-sound, patches, linux-mediatek,
	linux-arm-kernel, linux-riscv, linux-rtc, linux-stm32

On 28/05/2025 12:40, Krzysztof Kozlowski wrote:
> Pinctrl drivers for K210, TB10X and ZYNQ do not reference any machine
> headers, thus can be compile tested for increased build coverage.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
>  drivers/pinctrl/Kconfig | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig
> index 33db9104df178e5a3148b60c3c6bd153113385d3..77a5d13e899f8c5251987c2c74df1d05dbd59128 100644
> --- a/drivers/pinctrl/Kconfig
> +++ b/drivers/pinctrl/Kconfig
> @@ -269,7 +269,7 @@ config PINCTRL_INGENIC
>  
>  config PINCTRL_K210
>  	bool "Pinctrl driver for the Canaan Kendryte K210 SoC"
> -	depends on RISCV && SOC_CANAAN_K210 && OF
> +	depends on RISCV && SOC_CANAAN_K210 && OF || COMPILE_TEST
>  	select GENERIC_PINMUX_FUNCTIONS
LKP reported here issue, so there will be v2 of this.


Best regards,
Krzysztof

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

* Re: [PATCH 14/17] pinctrl: renesas: Move fixed assignments to 'pinctrl_desc' definition
  2025-05-28 17:55     ` Krzysztof Kozlowski
@ 2025-05-30  8:06       ` Geert Uytterhoeven
  0 siblings, 0 replies; 35+ messages in thread
From: Geert Uytterhoeven @ 2025-05-30  8:06 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Linus Walleij, Basavaraj Natikar, Shyam Sundar S K,
	Andrew Jeffery, Joel Stanley, Avi Fishman, Tomer Maimon,
	Tali Perry, Patrick Venture, Nancy Yuen, Benjamin Fair,
	Jonathan Neuschäfer, Rafał Miłecki,
	Broadcom internal kernel review list, Ray Jui, Scott Branden,
	Geert Uytterhoeven, David Rhodes, Richard Fitzgerald,
	Charles Keepax, Lorenzo Bianconi, Sean Wang, Jesper Nilsson,
	Lars Persson, Manivannan Sadhasivam, Damien Le Moal,
	Vladimir Zapolskiy, Michal Simek, Emil Renner Berthing,
	Jianlong Huang, Hal Feng, Matthias Brugger,
	AngeloGioacchino Del Regno, Alexandre Belloni, Maxime Coquelin,
	Alexandre Torgue, linux-gpio, linux-kernel, linux-aspeed, openbmc,
	linux-arm-kernel, linux-renesas-soc, linux-sound, patches,
	linux-mediatek, linux-arm-kernel, linux-riscv, linux-rtc,
	linux-stm32, Wolfram Sang

Hi Krzysztof,

CC wsa

On Wed, 28 May 2025 at 19:55, Krzysztof Kozlowski
<krzysztof.kozlowski@linaro.org> wrote:
> On 28/05/2025 14:54, Geert Uytterhoeven wrote:
> >>         .pmxops = &rzn1_pmx_ops,
> >>         .confops = &rzn1_pinconf_ops,
> >>         .owner = THIS_MODULE,
> >> +       .pins = rzn1_pins,
> >> +       .npins = ARRAY_SIZE(rzn1_pins),
> >>  };
> >>
> >>  static int rzn1_pinctrl_parse_groups(struct device_node *np,
> >> @@ -878,8 +880,6 @@ static int rzn1_pinctrl_probe(struct platform_device *pdev)
> >>
> >>         ipctl->dev = &pdev->dev;
> >>         rzn1_pinctrl_desc.name = dev_name(&pdev->dev);
> >
> > ... if you would replace this assignment by a hardcoded name
> > like "pinctrl-rzn1".
>
> I saw it, but this would not be equivalent. dev_name includes platform
> bus id, e.g. pinctrl-rzn1.0 which might matter here - conflict of names.
> Are you sure this would work fine?

There can be only one anyway.
Most drivers used a fixed name:

drivers/pinctrl/renesas/pinctrl-rza1.c: rza1_pctl->desc.name = DRIVER_NAME;
drivers/pinctrl/renesas/pinctrl-rza2.c: priv->desc.name = DRIVER_NAME;
drivers/pinctrl/renesas/pinctrl-rzg2l.c: pctrl->desc.name = DRV_NAME;
drivers/pinctrl/renesas/pinctrl-rzn1.c: rzn1_pinctrl_desc.name =
dev_name(&pdev->dev);
drivers/pinctrl/renesas/pinctrl-rzt2h.c: desc->name = DRV_NAME;
drivers/pinctrl/renesas/pinctrl-rzv2m.c: pctrl->desc.name = DRV_NAME;
drivers/pinctrl/renesas/pinctrl.c: pmx->pctl_desc.name = DRV_NAME;

It might change the path in debugfs (/sys/kernel/debug/pinctrl/) though.
Wolfram?

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH 16/17] pinctrl: Constify static 'pinctrl_desc'
  2025-05-28 10:41 ` [PATCH 16/17] pinctrl: " Krzysztof Kozlowski
  2025-05-28 12:51   ` Lorenzo Bianconi
  2025-05-28 16:41   ` Charles Keepax
@ 2025-06-03  9:40   ` Jesper Nilsson
  2 siblings, 0 replies; 35+ messages in thread
From: Jesper Nilsson @ 2025-06-03  9:40 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Linus Walleij, Basavaraj Natikar, Shyam Sundar S K,
	Andrew Jeffery, Joel Stanley, Avi Fishman, Tomer Maimon,
	Tali Perry, Patrick Venture, Nancy Yuen, Benjamin Fair,
	Jonathan Neuschäfer, Rafał Miłecki,
	Broadcom internal kernel review list, Ray Jui, Scott Branden,
	Geert Uytterhoeven, David Rhodes, Richard Fitzgerald,
	Charles Keepax, Lorenzo Bianconi, Sean Wang, Jesper Nilsson,
	Lars Persson, Manivannan Sadhasivam, Damien Le Moal,
	Vladimir Zapolskiy, Michal Simek, Emil Renner Berthing,
	Jianlong Huang, Hal Feng, Matthias Brugger,
	AngeloGioacchino Del Regno, Alexandre Belloni, Maxime Coquelin,
	Alexandre Torgue, linux-gpio, linux-kernel, linux-aspeed, openbmc,
	linux-arm-kernel, linux-renesas-soc, linux-sound, patches,
	linux-mediatek, linux-arm-kernel, linux-riscv, linux-rtc,
	linux-stm32

On Wed, May 28, 2025 at 12:41:12PM +0200, Krzysztof Kozlowski wrote
> The local static 'struct pinctrl_desc' is not modified, so can be made
> const for code safety.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

For artpec6:

Acked-by: Jesper Nilsson <jesper.nilsson@axis.com>

/^JN - Jesper Nilsson
-- 
               Jesper Nilsson -- jesper.nilsson@axis.com

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

* Re: [PATCH 00/17] pinctrl: Constify pointers to 'pinctrl_desc' and more
  2025-05-28 10:40 [PATCH 00/17] pinctrl: Constify pointers to 'pinctrl_desc' and more Krzysztof Kozlowski
                   ` (16 preceding siblings ...)
  2025-05-28 10:41 ` [PATCH 17/17] rtc: stm32: " Krzysztof Kozlowski
@ 2025-06-10 12:16 ` Linus Walleij
  2025-06-11  6:10   ` Krzysztof Kozlowski
  17 siblings, 1 reply; 35+ messages in thread
From: Linus Walleij @ 2025-06-10 12:16 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Basavaraj Natikar, Shyam Sundar S K, Andrew Jeffery, Joel Stanley,
	Avi Fishman, Tomer Maimon, Tali Perry, Patrick Venture,
	Nancy Yuen, Benjamin Fair, Jonathan Neuschäfer,
	Rafał Miłecki, Broadcom internal kernel review list,
	Ray Jui, Scott Branden, Geert Uytterhoeven, David Rhodes,
	Richard Fitzgerald, Charles Keepax, Lorenzo Bianconi, Sean Wang,
	Jesper Nilsson, Lars Persson, Manivannan Sadhasivam,
	Damien Le Moal, Vladimir Zapolskiy, Michal Simek,
	Emil Renner Berthing, Jianlong Huang, Hal Feng, Matthias Brugger,
	AngeloGioacchino Del Regno, Alexandre Belloni, Maxime Coquelin,
	Alexandre Torgue, linux-gpio, linux-kernel, linux-aspeed, openbmc,
	linux-arm-kernel, linux-renesas-soc, linux-sound, patches,
	linux-mediatek, linux-arm-kernel, linux-riscv, linux-rtc,
	linux-stm32

Hi Krzysztof,

On Wed, May 28, 2025 at 12:41 PM Krzysztof Kozlowski
<krzysztof.kozlowski@linaro.org> wrote:

> In several drivers pointers to 'struct pinctrl_desc' is not modified, so
> since core does not modify it, it can be made as const.

will you rebase this series on v6.16-rc1, fix the snags and send a new version?
It's all nice cleanups so it'd be great to just merge this.

Yours,
Linus Walleij

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

* Re: [PATCH 00/17] pinctrl: Constify pointers to 'pinctrl_desc' and more
  2025-06-10 12:16 ` [PATCH 00/17] pinctrl: Constify pointers to 'pinctrl_desc' and more Linus Walleij
@ 2025-06-11  6:10   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 35+ messages in thread
From: Krzysztof Kozlowski @ 2025-06-11  6:10 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Basavaraj Natikar, Shyam Sundar S K, Andrew Jeffery, Joel Stanley,
	Avi Fishman, Tomer Maimon, Tali Perry, Patrick Venture,
	Nancy Yuen, Benjamin Fair, Jonathan Neuschäfer,
	Rafał Miłecki, Broadcom internal kernel review list,
	Ray Jui, Scott Branden, Geert Uytterhoeven, David Rhodes,
	Richard Fitzgerald, Charles Keepax, Lorenzo Bianconi, Sean Wang,
	Jesper Nilsson, Lars Persson, Manivannan Sadhasivam,
	Damien Le Moal, Vladimir Zapolskiy, Michal Simek,
	Emil Renner Berthing, Jianlong Huang, Hal Feng, Matthias Brugger,
	AngeloGioacchino Del Regno, Alexandre Belloni, Maxime Coquelin,
	Alexandre Torgue, linux-gpio, linux-kernel, linux-aspeed, openbmc,
	linux-arm-kernel, linux-renesas-soc, linux-sound, patches,
	linux-mediatek, linux-arm-kernel, linux-riscv, linux-rtc,
	linux-stm32

On 10/06/2025 14:16, Linus Walleij wrote:
> Hi Krzysztof,
> 
> On Wed, May 28, 2025 at 12:41 PM Krzysztof Kozlowski
> <krzysztof.kozlowski@linaro.org> wrote:
> 
>> In several drivers pointers to 'struct pinctrl_desc' is not modified, so
>> since core does not modify it, it can be made as const.
> 
> will you rebase this series on v6.16-rc1, fix the snags and send a new version?
> It's all nice cleanups so it'd be great to just merge this.

Sure, coming soon.

Best regards,
Krzysztof

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

end of thread, other threads:[~2025-06-11  6:10 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-28 10:40 [PATCH 00/17] pinctrl: Constify pointers to 'pinctrl_desc' and more Krzysztof Kozlowski
2025-05-28 10:40 ` [PATCH 01/17] pinctrl: starfive: Allow compile testing on other platforms Krzysztof Kozlowski
2025-05-28 12:36   ` Geert Uytterhoeven
2025-05-28 12:51     ` Krzysztof Kozlowski
2025-05-28 10:40 ` [PATCH 02/17] pinctrl: Allow compile testing for K210, TB10X and ZYNQ Krzysztof Kozlowski
2025-05-29  6:26   ` Krzysztof Kozlowski
2025-05-28 10:40 ` [PATCH 03/17] pinctrl: amd: Constify pointers to 'pinctrl_desc' Krzysztof Kozlowski
2025-05-28 10:41 ` [PATCH 04/17] pinctrl: " Krzysztof Kozlowski
2025-05-28 12:47   ` Geert Uytterhoeven
2025-05-28 10:41 ` [PATCH 05/17] pinctrl: aspeed: Constify static 'pinctrl_desc' Krzysztof Kozlowski
2025-05-29  0:39   ` Andrew Jeffery
2025-05-28 10:41 ` [PATCH 06/17] pinctrl: nuvoton: " Krzysztof Kozlowski
2025-05-28 10:41 ` [PATCH 07/17] pinctrl: bcm: " Krzysztof Kozlowski
2025-05-28 16:45   ` Florian Fainelli
2025-05-28 10:41 ` [PATCH 08/17] pinctrl: bcm: cygnus-mux: Move fixed assignments to 'pinctrl_desc' definition Krzysztof Kozlowski
2025-05-28 16:46   ` Florian Fainelli
2025-05-28 10:41 ` [PATCH 09/17] pinctrl: bcm: cygnus-ns2: " Krzysztof Kozlowski
2025-05-28 16:46   ` Florian Fainelli
2025-05-28 10:41 ` [PATCH 10/17] pinctrl: bcm: cygnus-nsp: " Krzysztof Kozlowski
2025-05-28 16:46   ` Florian Fainelli
2025-05-28 10:41 ` [PATCH 11/17] pinctrl: as3722: " Krzysztof Kozlowski
2025-05-28 10:41 ` [PATCH 12/17] pinctrl: max77620: " Krzysztof Kozlowski
2025-05-28 10:41 ` [PATCH 13/17] pinctrl: palmas: " Krzysztof Kozlowski
2025-05-28 10:41 ` [PATCH 14/17] pinctrl: renesas: " Krzysztof Kozlowski
2025-05-28 12:54   ` Geert Uytterhoeven
2025-05-28 17:55     ` Krzysztof Kozlowski
2025-05-30  8:06       ` Geert Uytterhoeven
2025-05-28 10:41 ` [PATCH 15/17] pinctrl: pistachio: Constify static 'pinctrl_desc' Krzysztof Kozlowski
2025-05-28 10:41 ` [PATCH 16/17] pinctrl: " Krzysztof Kozlowski
2025-05-28 12:51   ` Lorenzo Bianconi
2025-05-28 16:41   ` Charles Keepax
2025-06-03  9:40   ` Jesper Nilsson
2025-05-28 10:41 ` [PATCH 17/17] rtc: stm32: " Krzysztof Kozlowski
2025-06-10 12:16 ` [PATCH 00/17] pinctrl: Constify pointers to 'pinctrl_desc' and more Linus Walleij
2025-06-11  6:10   ` Krzysztof Kozlowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).