summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQianfeng Rong <rongqianfeng@vivo.com>2025-08-31 16:49:56 +0800
committerLinus Walleij <linus.walleij@linaro.org>2025-09-08 14:20:57 +0200
commitdecd50c19f2ccce3cbe34f6f59d04b252119329d (patch)
tree9dce4fc5c7fe7e6c82ca8dfe7d093dbae096649f
parent050e711a48f18a6ce661ecf1b736dc07534f384a (diff)
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>
-rw-r--r--drivers/pinctrl/mvebu/pinctrl-armada-37xx.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c b/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
index 881df5e08f61..81dfbd5e7f07 100644
--- a/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
+++ b/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
@@ -420,7 +420,8 @@ static int armada_37xx_gpio_direction_output(struct gpio_chip *chip,
struct armada_37xx_pinctrl *info = gpiochip_get_data(chip);
unsigned int en_offset = offset;
unsigned int reg = OUTPUT_VAL;
- unsigned int mask, val, ret;
+ unsigned int mask, val;
+ int ret;
armada_37xx_update_reg(&reg, &offset);
mask = BIT(offset);
@@ -634,8 +635,9 @@ static int armada_37xx_edge_both_irq_swap_pol(struct armada_37xx_pinctrl *info,
{
u32 reg_idx = pin_idx / GPIO_PER_REG;
u32 bit_num = pin_idx % GPIO_PER_REG;
- u32 p, l, ret;
unsigned long flags;
+ u32 p, l;
+ int ret;
regmap_read(info->regmap, INPUT_VAL + 4*reg_idx, &l);