mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 20:07:46 +09:00
meson: pinctrl: fix coverity warning
PD#172720: meson: pinctrl: fix coverity warning The variable "reg" should be replaced by "ret", otherwise statement "if (ret) return ret;" will not be executed. This causes "Logically dead code". Change-Id: I2a69b68dd00235198e17255f78c580212f922724 Signed-off-by: Yingyuan Zhu <yingyuan.zhu@amlogic.com>
This commit is contained in:
committed by
Jianxin Pan
parent
ad433ca62b
commit
24e6416bb0
@@ -329,7 +329,7 @@ static int meson_pinconf_get_pio(struct meson_pinctrl *pc, unsigned int pin,
|
||||
return ret;
|
||||
meson_calc_reg_and_bit(bank, pin, REG_DIR, ®, &bit);
|
||||
|
||||
reg = regmap_read(pc->reg_gpio, reg, &val);
|
||||
ret = regmap_read(pc->reg_gpio, reg, &val);
|
||||
if (ret)
|
||||
return ret;
|
||||
if (val & BIT(bit)) {
|
||||
@@ -520,7 +520,9 @@ static int meson_gpio_get(struct gpio_chip *chip, unsigned int gpio)
|
||||
return ret;
|
||||
|
||||
meson_calc_reg_and_bit(bank, gpio, REG_IN, ®, &bit);
|
||||
regmap_read(pc->reg_gpio, reg, &val);
|
||||
ret = regmap_read(pc->reg_gpio, reg, &val);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
return !!(val & BIT(bit));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user