const struct mtk_pin_desc *desc;
int value, err;
- if (gpio > hw->soc->npins)
+ if (gpio >= hw->soc->npins)
return -EINVAL;
desc = (const struct mtk_pin_desc *)&hw->soc->pins[gpio];
int pinmux, pullup, pullen, len = 0, r1 = -1, r0 = -1;
const struct mtk_pin_desc *desc;
- if (gpio > hw->soc->npins)
+ if (gpio >= hw->soc->npins)
return -EINVAL;
desc = (const struct mtk_pin_desc *)&hw->soc->pins[gpio];
const struct mtk_pin_desc *desc;
int value, err;
- if (gpio > hw->soc->npins)
+ if (gpio >= hw->soc->npins)
return -EINVAL;
desc = (const struct mtk_pin_desc *)&hw->soc->pins[gpio];
const struct mtk_pin_desc *desc;
int value, err;
- if (gpio > hw->soc->npins)
+ if (gpio >= hw->soc->npins)
return -EINVAL;
desc = (const struct mtk_pin_desc *)&hw->soc->pins[gpio];
struct mtk_pinctrl *hw = gpiochip_get_data(chip);
const struct mtk_pin_desc *desc;
- if (gpio > hw->soc->npins)
+ if (gpio >= hw->soc->npins)
return;
desc = (const struct mtk_pin_desc *)&hw->soc->pins[gpio];
{
struct mtk_pinctrl *hw = gpiochip_get_data(chip);
- if (gpio > hw->soc->npins)
+ if (gpio >= hw->soc->npins)
return -EINVAL;
return pinctrl_gpio_direction_input(chip->base + gpio);
{
struct mtk_pinctrl *hw = gpiochip_get_data(chip);
- if (gpio > hw->soc->npins)
+ if (gpio >= hw->soc->npins)
return -EINVAL;
mtk_gpio_set(chip, gpio, value);