* [PATCH] pinctrl: renesas: checker: Fix for drive reg field increase
@ 2022-04-13 15:53 Geert Uytterhoeven
2022-04-14 5:44 ` Wolfram Sang
0 siblings, 1 reply; 3+ messages in thread
From: Geert Uytterhoeven @ 2022-04-13 15:53 UTC (permalink / raw)
To: Linus Walleij, Wolfram Sang
Cc: linux-gpio, linux-renesas-soc, Geert Uytterhoeven
With CONFIG_DEBUG_PINCTRL=y:
r8a774c0_pfc: pin GP_4_3: SH_PFC_PIN_CFG_DRIVE_STRENGTH flag set but not in drive_regs
r8a774c0_pfc: pin GP_4_4: SH_PFC_PIN_CFG_DRIVE_STRENGTH flag set but not in drive_regs
...
r8a77990_pfc: pin GP_4_3: SH_PFC_PIN_CFG_DRIVE_STRENGTH flag set but not in drive_regs
r8a77990_pfc: pin GP_4_4: SH_PFC_PIN_CFG_DRIVE_STRENGTH flag set but not in drive_regs
This happens because the checker still uses the old number of fields.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
To be folded into commit d5c9688095d29a6c ("pinctrl: renesas: Allow up
to 10 fields for drive_regs") in renesas-pinctrl-for-v5.19.
Ideally, some iterator or index helper should be introduced.
---
drivers/pinctrl/renesas/core.c | 32 ++++++++++++++++----------------
1 file changed, 16 insertions(+), 16 deletions(-)
diff --git a/drivers/pinctrl/renesas/core.c b/drivers/pinctrl/renesas/core.c
index d0d4714731c14cf5..dae2201a62dc8f8b 100644
--- a/drivers/pinctrl/renesas/core.c
+++ b/drivers/pinctrl/renesas/core.c
@@ -1076,17 +1076,17 @@ static void __init sh_pfc_check_info(const struct sh_pfc_soc_info *info)
if (!drive_regs) {
sh_pfc_err_once(drive, "SH_PFC_PIN_CFG_DRIVE_STRENGTH flag set but drive_regs missing\n");
} else {
- for (j = 0; drive_regs[j / 8].reg; j++) {
- if (!drive_regs[j / 8].fields[j % 8].pin &&
- !drive_regs[j / 8].fields[j % 8].offset &&
- !drive_regs[j / 8].fields[j % 8].size)
+ for (j = 0; drive_regs[j / 10].reg; j++) {
+ if (!drive_regs[j / 10].fields[j % 10].pin &&
+ !drive_regs[j / 10].fields[j % 10].offset &&
+ !drive_regs[j / 10].fields[j % 10].size)
continue;
- if (drive_regs[j / 8].fields[j % 8].pin == pin->pin)
+ if (drive_regs[j / 10].fields[j % 10].pin == pin->pin)
break;
}
- if (!drive_regs[j / 8].reg)
+ if (!drive_regs[j / 10].reg)
sh_pfc_err("pin %s: SH_PFC_PIN_CFG_DRIVE_STRENGTH flag set but not in drive_regs\n",
pin->name);
}
@@ -1164,20 +1164,20 @@ static void __init sh_pfc_check_info(const struct sh_pfc_soc_info *info)
for (i = 0; drive_regs && drive_regs[i].reg; i++)
sh_pfc_check_drive_reg(info, &drive_regs[i]);
- for (i = 0; drive_regs && drive_regs[i / 8].reg; i++) {
- if (!drive_regs[i / 8].fields[i % 8].pin &&
- !drive_regs[i / 8].fields[i % 8].offset &&
- !drive_regs[i / 8].fields[i % 8].size)
+ for (i = 0; drive_regs && drive_regs[i / 10].reg; i++) {
+ if (!drive_regs[i / 10].fields[i % 10].pin &&
+ !drive_regs[i / 10].fields[i % 10].offset &&
+ !drive_regs[i / 10].fields[i % 10].size)
continue;
for (j = 0; j < i; j++) {
- if (drive_regs[i / 8].fields[i % 8].pin ==
- drive_regs[j / 8].fields[j % 8].pin &&
- drive_regs[j / 8].fields[j % 8].offset &&
- drive_regs[j / 8].fields[j % 8].size) {
+ if (drive_regs[i / 10].fields[i % 10].pin ==
+ drive_regs[j / 10].fields[j % 10].pin &&
+ drive_regs[j / 10].fields[j % 10].offset &&
+ drive_regs[j / 10].fields[j % 10].size) {
sh_pfc_err("drive_reg 0x%x:%u/0x%x:%u: pin conflict\n",
- drive_regs[i / 8].reg, i % 8,
- drive_regs[j / 8].reg, j % 8);
+ drive_regs[i / 10].reg, i % 10,
+ drive_regs[j / 10].reg, j % 10);
}
}
}
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] pinctrl: renesas: checker: Fix for drive reg field increase
2022-04-13 15:53 [PATCH] pinctrl: renesas: checker: Fix for drive reg field increase Geert Uytterhoeven
@ 2022-04-14 5:44 ` Wolfram Sang
2022-04-14 13:57 ` Geert Uytterhoeven
0 siblings, 1 reply; 3+ messages in thread
From: Wolfram Sang @ 2022-04-14 5:44 UTC (permalink / raw)
To: Geert Uytterhoeven; +Cc: Linus Walleij, linux-gpio, linux-renesas-soc
[-- Attachment #1: Type: text/plain, Size: 422 bytes --]
> This happens because the checker still uses the old number of fields.
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> To be folded into commit d5c9688095d29a6c ("pinctrl: renesas: Allow up
> to 10 fields for drive_regs") in renesas-pinctrl-for-v5.19.
>
> Ideally, some iterator or index helper should be introduced.
What about a #define instead of a hard-coded value until then?
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] pinctrl: renesas: checker: Fix for drive reg field increase
2022-04-14 5:44 ` Wolfram Sang
@ 2022-04-14 13:57 ` Geert Uytterhoeven
0 siblings, 0 replies; 3+ messages in thread
From: Geert Uytterhoeven @ 2022-04-14 13:57 UTC (permalink / raw)
To: Wolfram Sang, Linus Walleij, open list:GPIO SUBSYSTEM, Linux-Renesas
Hi Wolfram,
On Thu, Apr 14, 2022 at 7:44 AM Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
> > This happens because the checker still uses the old number of fields.
> >
> > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> > ---
> > To be folded into commit d5c9688095d29a6c ("pinctrl: renesas: Allow up
> > to 10 fields for drive_regs") in renesas-pinctrl-for-v5.19.
> >
> > Ideally, some iterator or index helper should be introduced.
>
> What about a #define instead of a hard-coded value until then?
That would be an option. But I bit the bullet, and introduced a few
helpers in v2 instead.
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] 3+ messages in thread
end of thread, other threads:[~2022-04-14 14:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-13 15:53 [PATCH] pinctrl: renesas: checker: Fix for drive reg field increase Geert Uytterhoeven
2022-04-14 5:44 ` Wolfram Sang
2022-04-14 13:57 ` Geert Uytterhoeven
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.