gpio: rockchip: fix get gpio mux operation error return
Change-Id: Ia225ae3acea2d2d2347870b3d6a20c4a7d22e7e9 Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
This commit is contained in:
parent
8273b391c5
commit
e9c98b3baf
|
|
@ -109,11 +109,13 @@ static int rockchip_gpio_get_function(struct udevice *dev, unsigned offset)
|
|||
int ret;
|
||||
|
||||
ret = pinctrl_get_gpio_mux(priv->pinctrl, priv->bank, offset);
|
||||
if (ret)
|
||||
if (ret < 0) {
|
||||
dev_err(dev, "fail to get gpio mux %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* If it's not 0, then it is not a GPIO */
|
||||
if (ret)
|
||||
if (ret > 0)
|
||||
return GPIOF_FUNC;
|
||||
|
||||
is_output = READ_REG(®s->swport_ddr) & OFFSET_TO_BIT(offset);
|
||||
|
|
|
|||
Loading…
Reference in New Issue