Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

pinctrl: armada-37xx: Use int type to store negative error codes

In armada_37xx_gpio_direction_output(), the 'ret' variable might store
the negative error codes returned by regmap_update_bits(), and in
armada_37xx_edge_both_irq_swap_pol(), the 'ret' variable directly
stores -1, so the type of the 'ret' variable needs to be changed to
int in both cases.

No effect on runtime.

Signed-off-by: Qianfeng Rong <rongqianfeng@vivo.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

authored by

Qianfeng Rong and committed by
Linus Walleij
decd50c1 050e711a

+4 -2
+4 -2
drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
··· 420 420 struct armada_37xx_pinctrl *info = gpiochip_get_data(chip); 421 421 unsigned int en_offset = offset; 422 422 unsigned int reg = OUTPUT_VAL; 423 - unsigned int mask, val, ret; 423 + unsigned int mask, val; 424 + int ret; 424 425 425 426 armada_37xx_update_reg(&reg, &offset); 426 427 mask = BIT(offset); ··· 635 634 { 636 635 u32 reg_idx = pin_idx / GPIO_PER_REG; 637 636 u32 bit_num = pin_idx % GPIO_PER_REG; 638 - u32 p, l, ret; 639 637 unsigned long flags; 638 + u32 p, l; 639 + int ret; 640 640 641 641 regmap_read(info->regmap, INPUT_VAL + 4*reg_idx, &l); 642 642