From 2b4fdd1902cfaa066fe5a8c583bcf92f029c1753 Mon Sep 17 00:00:00 2001 From: Manoel Brunnen Date: Wed, 3 May 2023 13:54:12 +0200 Subject: [PATCH] drivers: pinctrl: imx: Use sys_write32 function sys_write32 does the exact same thing, but increases the readability. Signed-off-by: Manoel Brunnen --- drivers/pinctrl/pinctrl_imx.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/pinctrl/pinctrl_imx.c b/drivers/pinctrl/pinctrl_imx.c index 88899930c1..6302136068 100644 --- a/drivers/pinctrl/pinctrl_imx.c +++ b/drivers/pinctrl/pinctrl_imx.c @@ -45,19 +45,19 @@ int pinctrl_configure_pins(const pinctrl_soc_pin_t *pins, uint8_t pin_cnt, (mem_addr_t)config_register); } #else - *((volatile uint32_t *)((uintptr_t)mux_register)) = + sys_write32( IOMUXC_SW_MUX_CTL_PAD_MUX_MODE(mux_mode) | - IOMUXC_SW_MUX_CTL_PAD_SION(MCUX_IMX_INPUT_ENABLE(pin_ctrl_flags)); + IOMUXC_SW_MUX_CTL_PAD_SION(MCUX_IMX_INPUT_ENABLE(pin_ctrl_flags)), + (mem_addr_t)mux_register); if (input_register) { - *((volatile uint32_t *)((uintptr_t)input_register)) = - IOMUXC_SELECT_INPUT_DAISY(input_daisy); + sys_write32(IOMUXC_SELECT_INPUT_DAISY(input_daisy), + (mem_addr_t)input_register); } if (config_register) { - *((volatile uint32_t *)((uintptr_t)config_register)) = - pin_ctrl_flags & (~(0x1 << MCUX_IMX_INPUT_ENABLE_SHIFT)); + sys_write32(pin_ctrl_flags & (~(0x1 << MCUX_IMX_INPUT_ENABLE_SHIFT)), + config_register); } #endif - } return 0; }