struct gb_gpio_controller *gb_gpio_controller = gpio_chip_to_gb_gpio_controller(chip);
int ret;
- if (offset < 0 || offset >= chip->ngpio)
+ if (offset >= chip->ngpio)
return -EINVAL;
ret = gb_gpio_activate_operation(gb_gpio_controller, (u8)offset);
if (ret)
struct gb_gpio_controller *gb_gpio_controller = gpio_chip_to_gb_gpio_controller(chip);
int ret;
- if (offset < 0 || offset >= chip->ngpio) {
+ if (offset >= chip->ngpio) {
pr_err("bad offset %u supplied (must be 0..%u)\n",
offset, chip->ngpio - 1);
return;
u8 which;
int ret;
- if (offset < 0 || offset >= chip->ngpio)
+ if (offset >= chip->ngpio)
return -EINVAL;
which = (u8)offset;
ret = gb_gpio_get_direction_operation(gb_gpio_controller, which);
struct gb_gpio_controller *gb_gpio_controller = gpio_chip_to_gb_gpio_controller(chip);
int ret;
- if (offset < 0 || offset >= chip->ngpio)
+ if (offset >= chip->ngpio)
return -EINVAL;
ret = gb_gpio_direction_in_operation(gb_gpio_controller, (u8)offset);
if (ret)
struct gb_gpio_controller *gb_gpio_controller = gpio_chip_to_gb_gpio_controller(chip);
int ret;
- if (offset < 0 || offset >= chip->ngpio)
+ if (offset >= chip->ngpio)
return -EINVAL;
ret = gb_gpio_direction_out_operation(gb_gpio_controller, (u8)offset, !!value);
if (ret)
u8 which;
int ret;
- if (offset < 0 || offset >= chip->ngpio)
+ if (offset >= chip->ngpio)
return -EINVAL;
which = (u8)offset;
ret = gb_gpio_get_value_operation(gb_gpio_controller, which);
u16 usec;
int ret;
- if (offset < 0 || offset >= chip->ngpio)
+ if (offset >= chip->ngpio)
return -EINVAL;
if (debounce > (unsigned int)U16_MAX)
return -EINVAL;
static int gb_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
{
- if (offset < 0 || offset >= chip->ngpio)
+ if (offset >= chip->ngpio)
return -EINVAL;
return 0; /* XXX */