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