From 03135f4604635894f472041583bed5b3aec6e216 Mon Sep 17 00:00:00 2001 From: Julien Massot Date: Wed, 19 Jan 2022 14:19:14 +0100 Subject: [PATCH] drivers: pinctrl: pfc_rcar: fix bank and bit parsing Bank and Bit has been inverted at some point. Fix that ! Signed-off-by: Julien Massot --- drivers/pinctrl/pfc_rcar.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pinctrl/pfc_rcar.c b/drivers/pinctrl/pfc_rcar.c index 489f69416a9..0aabf669a33 100644 --- a/drivers/pinctrl/pfc_rcar.c +++ b/drivers/pinctrl/pfc_rcar.c @@ -38,8 +38,8 @@ static void pfc_rcar_write(uint32_t offs, uint32_t val) /* Set the pin either in gpio or peripheral */ static void pfc_rcar_set_gpsr(uint16_t pin, bool peripheral) { - uint8_t bank = pin % 32; - uint8_t bit = pin / 32; + uint8_t bank = pin / 32; + uint8_t bit = pin % 32; uint32_t val = sys_read32(PFC_REG_BASE + PFC_RCAR_GPSR + bank * sizeof(uint32_t));