From b74a2162cb191503edab62387f823e451743aed6 Mon Sep 17 00:00:00 2001 From: Erwan Gouriou Date: Thu, 8 Oct 2020 17:24:07 +0200 Subject: [PATCH] soc/arm: stm32: swap argument order in ST_STM32 PINCTRL macros In order to be in line with other DT_INST macros in zephyr code base, swap the arguments order in following macro definitions: *ST_STM32_DT_PINCTRL *ST_STM32_DT_INST_PINCTRL Update the users accordingly. Signed-off-by: Erwan Gouriou --- drivers/i2c/i2c_ll_stm32.c | 2 +- drivers/pwm/pwm_stm32.c | 2 +- drivers/serial/uart_stm32.c | 2 +- soc/arm/st_stm32/common/st_stm32_dt.h | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/i2c/i2c_ll_stm32.c b/drivers/i2c/i2c_ll_stm32.c index b66124b77d6..438b2a8889b 100644 --- a/drivers/i2c/i2c_ll_stm32.c +++ b/drivers/i2c/i2c_ll_stm32.c @@ -352,7 +352,7 @@ STM32_I2C_IRQ_HANDLER_DECL(name); \ DEFINE_TIMINGS(name) \ \ static const struct soc_gpio_pinctrl i2c_pins_##name[] = \ - ST_STM32_DT_PINCTRL(0, name); \ + ST_STM32_DT_PINCTRL(name, 0); \ \ static const struct i2c_stm32_config i2c_stm32_cfg_##name = { \ .i2c = (I2C_TypeDef *)DT_REG_ADDR(DT_NODELABEL(name)), \ diff --git a/drivers/pwm/pwm_stm32.c b/drivers/pwm/pwm_stm32.c index 549ef72f224..f618245474b 100644 --- a/drivers/pwm/pwm_stm32.c +++ b/drivers/pwm/pwm_stm32.c @@ -461,7 +461,7 @@ static int pwm_stm32_init(const struct device *dev) static struct pwm_stm32_data pwm_stm32_data_##index; \ \ static const struct soc_gpio_pinctrl pwm_pins_##index[] = \ - ST_STM32_DT_INST_PINCTRL(0, index); \ + ST_STM32_DT_INST_PINCTRL(index, 0); \ \ static const struct pwm_stm32_config pwm_stm32_config_##index = { \ .timer = (TIM_TypeDef *)DT_REG_ADDR( \ diff --git a/drivers/serial/uart_stm32.c b/drivers/serial/uart_stm32.c index 7bda80a68ea..4fda83018d7 100644 --- a/drivers/serial/uart_stm32.c +++ b/drivers/serial/uart_stm32.c @@ -815,7 +815,7 @@ static void uart_stm32_irq_config_func_##index(const struct device *dev) \ STM32_UART_IRQ_HANDLER_DECL(index); \ \ static const struct soc_gpio_pinctrl uart_pins_##index[] = \ - ST_STM32_DT_INST_PINCTRL(0, index); \ + ST_STM32_DT_INST_PINCTRL(index, 0); \ \ static const struct uart_stm32_config uart_stm32_cfg_##index = { \ .uconf = { \ diff --git a/soc/arm/st_stm32/common/st_stm32_dt.h b/soc/arm/st_stm32/common/st_stm32_dt.h index e7a498ed5b8..88b738ae52f 100644 --- a/soc/arm/st_stm32/common/st_stm32_dt.h +++ b/soc/arm/st_stm32/common/st_stm32_dt.h @@ -261,11 +261,11 @@ * This macro returns an array of soc_gpio_pinctrl, each line matching a pinctrl * configuration provived in property pcintrl- of device instance * - * @param x index of targeted pinctrl- property (eg: pinctrl-) * @param inst device instance number + * @param x index of targeted pinctrl- property (eg: pinctrl-) * @return array of soc_gpio_pinctrl */ -#define ST_STM32_DT_INST_PINCTRL(x, inst) \ +#define ST_STM32_DT_INST_PINCTRL(inst, x) \ { COND_CODE_1(DT_INST_NODE_HAS_PROP(inst, pinctrl_##x), \ (UTIL_LISTIFY(ST_STM32_DT_INST_NUM_PINS(inst, x), \ ST_STM32_DT_INST_PIN_ELEM, \ @@ -282,11 +282,11 @@ * configuration provived in property pcintrl- of a device referenced by * its node label identifier. * - * @param x index of targeted pinctrl- property (eg: pinctrl-) * @param name device node label identifier + * @param x index of targeted pinctrl- property (eg: pinctrl-) * @return array of soc_gpio_pinctrl */ -#define ST_STM32_DT_PINCTRL(x, name) \ +#define ST_STM32_DT_PINCTRL(name, x) \ { COND_CODE_1(DT_NODE_HAS_PROP(DT_NODELABEL(name), pinctrl_##x),\ (UTIL_LISTIFY(ST_STM32_DT_NUM_PINS(name, x), \ ST_STM32_DT_PIN_ELEM, \