summaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/gpio.c
diff options
context:
space:
mode:
authorJohan Hovold <johan@hovoldconsulting.com>2015-03-19 16:51:11 +0100
committerGreg Kroah-Hartman <greg@kroah.com>2015-03-19 17:29:40 +0100
commit65f5a5f1614d1a3dab375588f5fd03590c87215b (patch)
tree8c78244aa1dcc08b89ac9c705d89173e0f39f2db /drivers/staging/greybus/gpio.c
parent56c2da1873d68b96458064a306e5bb4c50ccdb5d (diff)
greybus: gpio: remove redundant argument verification
Remove redundant verification of gpio numbers (which have already been verified in the gpio-chip callbacks) from greybus-operation helpers. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
Diffstat (limited to 'drivers/staging/greybus/gpio.c')
-rw-r--r--drivers/staging/greybus/gpio.c24
1 files changed, 0 insertions, 24 deletions
diff --git a/drivers/staging/greybus/gpio.c b/drivers/staging/greybus/gpio.c
index 6a493d4758b4..a1bf1430fced 100644
--- a/drivers/staging/greybus/gpio.c
+++ b/drivers/staging/greybus/gpio.c
@@ -167,9 +167,6 @@ static int gb_gpio_activate_operation(struct gb_gpio_controller *ggc, u8 which)
struct gb_gpio_activate_request request;
int ret;
- if (which > ggc->line_max)
- return -EINVAL;
-
request.which = which;
ret = gb_operation_sync(ggc->connection, GB_GPIO_TYPE_ACTIVATE,
&request, sizeof(request), NULL, 0);
@@ -184,9 +181,6 @@ static int gb_gpio_deactivate_operation(struct gb_gpio_controller *ggc,
struct gb_gpio_deactivate_request request;
int ret;
- if (which > ggc->line_max)
- return -EINVAL;
-
request.which = which;
ret = gb_operation_sync(ggc->connection, GB_GPIO_TYPE_DEACTIVATE,
&request, sizeof(request), NULL, 0);
@@ -203,9 +197,6 @@ static int gb_gpio_get_direction_operation(struct gb_gpio_controller *ggc,
int ret;
u8 direction;
- if (which > ggc->line_max)
- return -EINVAL;
-
request.which = which;
ret = gb_operation_sync(ggc->connection, GB_GPIO_TYPE_GET_DIRECTION,
&request, sizeof(request),
@@ -227,9 +218,6 @@ static int gb_gpio_direction_in_operation(struct gb_gpio_controller *ggc,
struct gb_gpio_direction_in_request request;
int ret;
- if (which > ggc->line_max)
- return -EINVAL;
-
request.which = which;
ret = gb_operation_sync(ggc->connection, GB_GPIO_TYPE_DIRECTION_IN,
&request, sizeof(request), NULL, 0);
@@ -244,9 +232,6 @@ static int gb_gpio_direction_out_operation(struct gb_gpio_controller *ggc,
struct gb_gpio_direction_out_request request;
int ret;
- if (which > ggc->line_max)
- return -EINVAL;
-
request.which = which;
request.value = value_high ? 1 : 0;
ret = gb_operation_sync(ggc->connection, GB_GPIO_TYPE_DIRECTION_OUT,
@@ -264,9 +249,6 @@ static int gb_gpio_get_value_operation(struct gb_gpio_controller *ggc,
int ret;
u8 value;
- if (which > ggc->line_max)
- return -EINVAL;
-
request.which = which;
ret = gb_operation_sync(ggc->connection, GB_GPIO_TYPE_GET_VALUE,
&request, sizeof(request),
@@ -288,9 +270,6 @@ static int gb_gpio_set_value_operation(struct gb_gpio_controller *ggc,
struct gb_gpio_set_value_request request;
int ret;
- if (which > ggc->line_max)
- return -EINVAL;
-
request.which = which;
request.value = value_high ? 1 : 0;
ret = gb_operation_sync(ggc->connection, GB_GPIO_TYPE_SET_VALUE,
@@ -308,9 +287,6 @@ static int gb_gpio_set_debounce_operation(struct gb_gpio_controller *ggc,
struct gb_gpio_set_debounce_request request;
int ret;
- if (which > ggc->line_max)
- return -EINVAL;
-
request.which = which;
request.usec = cpu_to_le16(debounce_usec);
ret = gb_operation_sync(ggc->connection, GB_GPIO_TYPE_SET_DEBOUNCE,