Thread (35 messages) 35 messages, 8 authors, 2025-06-11

Re: [PATCH 14/17] pinctrl: renesas: Move fixed assignments to 'pinctrl_desc' definition

From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: 2025-05-28 13:01:52
Also in: linux-gpio, linux-mediatek, linux-renesas-soc, linux-riscv, linux-rtc, linux-sound, lkml, openbmc

Hi Krzysztof,

On Wed, 28 May 2025 at 12:42, Krzysztof Kozlowski
[off-list ref] 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 <redacted>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
quoted hunk ↗ jump to hunk
--- 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...
quoted hunk ↗ jump to hunk
        .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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help