mirror of
https://github.com/torvalds/linux.git
synced 2026-05-31 02:24:24 +02:00
pinctrl: stm32: Rework stm32_pconf_parse_conf()
Reduce the number of parameters of the function by moving inside the function the decoding of the field 'config'. While there: - change the type of 'param' to 'unsigned int' to handle the extra values not in 'enum pin_config_param'; - change the type of 'arg' to 'u32' to avoid additional conversions and align to 'u32' the corresponding param of __stm32_gpio_set(). Signed-off-by: Antonio Borneo <antonio.borneo@foss.st.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
parent
5c284d086b
commit
5a0398cc2a
|
|
@ -287,7 +287,7 @@ static void stm32_gpio_rif_release_semaphore(struct stm32_gpio_bank *bank, unsig
|
|||
/* GPIO functions */
|
||||
|
||||
static inline void __stm32_gpio_set(struct stm32_gpio_bank *bank,
|
||||
unsigned offset, int value)
|
||||
unsigned int offset, u32 value)
|
||||
{
|
||||
stm32_gpio_backup_value(bank, offset, value);
|
||||
|
||||
|
|
@ -1195,10 +1195,11 @@ static bool stm32_pconf_get(struct stm32_gpio_bank *bank,
|
|||
}
|
||||
|
||||
static int stm32_pconf_parse_conf(struct pinctrl_dev *pctldev,
|
||||
unsigned int pin, enum pin_config_param param,
|
||||
enum pin_config_param arg)
|
||||
unsigned int pin, unsigned long config)
|
||||
{
|
||||
struct stm32_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
|
||||
unsigned int param = pinconf_to_config_param(config);
|
||||
u32 arg = pinconf_to_config_argument(config);
|
||||
struct pinctrl_gpio_range *range;
|
||||
struct stm32_gpio_bank *bank;
|
||||
int offset, ret = 0;
|
||||
|
|
@ -1267,9 +1268,7 @@ static int stm32_pconf_group_set(struct pinctrl_dev *pctldev, unsigned group,
|
|||
|
||||
for (i = 0; i < num_configs; i++) {
|
||||
mutex_lock(&pctldev->mutex);
|
||||
ret = stm32_pconf_parse_conf(pctldev, g->pin,
|
||||
pinconf_to_config_param(configs[i]),
|
||||
pinconf_to_config_argument(configs[i]));
|
||||
ret = stm32_pconf_parse_conf(pctldev, g->pin, configs[i]);
|
||||
mutex_unlock(&pctldev->mutex);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
|
@ -1286,9 +1285,7 @@ static int stm32_pconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
|
|||
int i, ret;
|
||||
|
||||
for (i = 0; i < num_configs; i++) {
|
||||
ret = stm32_pconf_parse_conf(pctldev, pin,
|
||||
pinconf_to_config_param(configs[i]),
|
||||
pinconf_to_config_argument(configs[i]));
|
||||
ret = stm32_pconf_parse_conf(pctldev, pin, configs[i]);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user