From: Marek Vasut Date: Tue, 19 Jun 2018 04:13:42 +0000 (+0200) Subject: pinctrl: renesas: Fix register usage in sh_pfc_{read,write} X-Git-Tag: v2018.07-rc3~21^2~8 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=5af654197263dfac08e17d24e477e27c6990df72;p=u-boot pinctrl: renesas: Fix register usage in sh_pfc_{read,write} The sh_pfc_{read,write}() must operate on the register address directly rather than on an offset, fix this to prevent illegal access. Signed-off-by: Marek Vasut Cc: Nobuhiro Iwamatsu --- diff --git a/drivers/pinctrl/renesas/pfc.c b/drivers/pinctrl/renesas/pfc.c index 6aa2e13f3e..90011537a8 100644 --- a/drivers/pinctrl/renesas/pfc.c +++ b/drivers/pinctrl/renesas/pfc.c @@ -121,7 +121,7 @@ void sh_pfc_write_raw_reg(void __iomem *mapped_reg, unsigned int reg_width, u32 sh_pfc_read(struct sh_pfc *pfc, u32 reg) { - return sh_pfc_read_raw_reg(pfc->regs + reg, 32); + return sh_pfc_read_raw_reg((void __iomem *)(uintptr_t)reg, 32); } void sh_pfc_write(struct sh_pfc *pfc, u32 reg, u32 data) @@ -132,7 +132,7 @@ void sh_pfc_write(struct sh_pfc *pfc, u32 reg, u32 data) if (pfc->info->unlock_reg) sh_pfc_write_raw_reg(unlock_reg, 32, ~data); - sh_pfc_write_raw_reg(pfc->regs + reg, 32, data); + sh_pfc_write_raw_reg((void __iomem *)(uintptr_t)reg, 32, data); } static void sh_pfc_config_reg_helper(struct sh_pfc *pfc,