diff options
author | Geert Uytterhoeven <geert+renesas@glider.be> | 2021-12-23 15:56:18 +0100 |
---|---|---|
committer | Geert Uytterhoeven <geert+renesas@glider.be> | 2022-02-22 09:57:18 +0100 |
commit | ceb8d2acbb2a9dd98baaaff1a9e237dcaeeb44c5 (patch) | |
tree | d33faf481ac64f3599cf2049c841efbf8fb0991e /drivers/pinctrl/renesas/pfc-r8a7740.c | |
parent | pinctrl: renesas: Remove unused pfc parameter from .pin_to_pocctrl() (diff) | |
download | linux-ceb8d2acbb2a9dd98baaaff1a9e237dcaeeb44c5.tar.xz linux-ceb8d2acbb2a9dd98baaaff1a9e237dcaeeb44c5.zip |
pinctrl: renesas: Factor out .pin_to_portcr() address handling
All implementations of the .pin_to_portcr() method implement the same
conversion from Port Control Register offset to virtual address. Factor
it out into the two callers.
Remove the pfc parameter, as it is no longer used.
Note that the failure handling in r8a7740_pin_to_portcr() is pro forma,
as the function is never called with an invalid pin number.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/a485d4986a17259256988eb14e3a4c2b8d61c303.1640270559.git.geert+renesas@glider.be
Diffstat (limited to 'drivers/pinctrl/renesas/pfc-r8a7740.c')
-rw-r--r-- | drivers/pinctrl/renesas/pfc-r8a7740.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/pinctrl/renesas/pfc-r8a7740.c b/drivers/pinctrl/renesas/pfc-r8a7740.c index 3214331ba4e2..e8b9fb74a802 100644 --- a/drivers/pinctrl/renesas/pfc-r8a7740.c +++ b/drivers/pinctrl/renesas/pfc-r8a7740.c @@ -3495,7 +3495,7 @@ static const struct r8a7740_portcr_group r8a7740_portcr_offsets[] = { { 83, 0x0000 }, { 114, 0x1000 }, { 209, 0x2000 }, { 211, 0x3000 }, }; -static void __iomem *r8a7740_pin_to_portcr(struct sh_pfc *pfc, unsigned int pin) +static int r8a7740_pin_to_portcr(unsigned int pin) { unsigned int i; @@ -3504,10 +3504,10 @@ static void __iomem *r8a7740_pin_to_portcr(struct sh_pfc *pfc, unsigned int pin) &r8a7740_portcr_offsets[i]; if (pin <= group->end_pin) - return pfc->windows->virt + group->offset + pin; + return group->offset + pin; } - return NULL; + return -1; } static const struct sh_pfc_soc_operations r8a7740_pfc_ops = { |