提交 c2944a9a 编写于 作者: D Dan Carpenter 提交者: Linus Walleij

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: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
上级 504c7697
......@@ -101,15 +101,16 @@ 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,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册