Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c2944a9a authored by Dan Carpenter's avatar Dan Carpenter Committed by Linus Walleij
Browse files

pinctrl: nomadik: silence uninitialized variable warning



This is harmless, but "val" isn't necessarily initialized if
abx500_get_register_interruptible() fails.  I've re-arranged the code to
just return an error code in that situation.

Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 504c7697
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -101,17 +101,18 @@ static int abx500_gpio_get_bit(struct gpio_chip *chip, u8 reg,
	reg += offset / 8;
	ret = abx500_get_register_interruptible(pct->dev,
						AB8500_MISC, reg, &val);

	*bit = !!(val & BIT(pos));

	if (ret < 0)
	if (ret < 0) {
		dev_err(pct->dev,
			"%s read reg =%x, offset=%x failed (%d)\n",
			__func__, reg, offset, ret);

		return ret;
	}

	*bit = !!(val & BIT(pos));

	return 0;
}

static int abx500_gpio_set_bits(struct gpio_chip *chip, u8 reg,
				unsigned offset, int val)
{