[PATCH] pinctrl: stm32: Constify static 'pinctrl_desc'

Krzysztof Kozlowski posted 1 patch 1 month, 2 weeks ago
drivers/pinctrl/stm32/pinctrl-stm32-hdp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] pinctrl: stm32: Constify static 'pinctrl_desc'
Posted by Krzysztof Kozlowski 1 month, 2 weeks ago
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/stm32/pinctrl-stm32-hdp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pinctrl/stm32/pinctrl-stm32-hdp.c b/drivers/pinctrl/stm32/pinctrl-stm32-hdp.c
index e91442eb566b..0cd41f3f7a52 100644
--- a/drivers/pinctrl/stm32/pinctrl-stm32-hdp.c
+++ b/drivers/pinctrl/stm32/pinctrl-stm32-hdp.c
@@ -575,7 +575,7 @@ static const struct pinmux_ops stm32_hdp_pinmux_ops = {
 	.gpio_set_direction  = NULL,
 };
 
-static struct pinctrl_desc stm32_hdp_pdesc = {
+static const struct pinctrl_desc stm32_hdp_pdesc = {
 	.name	 = DRIVER_NAME,
 	.pins	 = stm32_hdp_pins,
 	.npins	 = ARRAY_SIZE(stm32_hdp_pins),
-- 
2.48.1
Re: [PATCH] pinctrl: stm32: Constify static 'pinctrl_desc'
Posted by Linus Walleij 1 month, 2 weeks ago
On Mon, Aug 18, 2025 at 4:24 PM Krzysztof Kozlowski
<krzysztof.kozlowski@linaro.org> 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>

Patch applied!

Yours,
Linus Walleij