diff options
author | Arve Hjønnevåg <arve@android.com> | 2010-04-01 19:52:27 -0700 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2010-09-29 17:49:41 -0700 |
commit | 77598e8316d2aa1de9f290afdcc97e409ba585b8 (patch) | |
tree | 6810fea55fa7e6363d2f7dce9034321fce307087 /drivers/input | |
parent | 325c547f8b9797b9dfe253b8147b54dc4691109b (diff) |
Input: gpio_event: Don't call gpio_cansleep before gpio_request.
If the gpio did not exist it would crash in gpiolib.
Signed-off-by: Arve Hjønnevåg <arve@android.com>
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/misc/gpio_matrix.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/input/misc/gpio_matrix.c b/drivers/input/misc/gpio_matrix.c index f645471b54dd..08b881325eac 100644 --- a/drivers/input/misc/gpio_matrix.c +++ b/drivers/input/misc/gpio_matrix.c @@ -336,18 +336,18 @@ int gpio_event_matrix_func(struct gpio_event_input_devs *input_devs, } for (i = 0; i < mi->noutputs; i++) { - if (gpio_cansleep(mi->output_gpios[i])) { - pr_err("gpiomatrix: unsupported output gpio %d," - " can sleep\n", mi->output_gpios[i]); - err = -EINVAL; - goto err_request_output_gpio_failed; - } err = gpio_request(mi->output_gpios[i], "gpio_kp_out"); if (err) { pr_err("gpiomatrix: gpio_request failed for " "output %d\n", mi->output_gpios[i]); goto err_request_output_gpio_failed; } + if (gpio_cansleep(mi->output_gpios[i])) { + pr_err("gpiomatrix: unsupported output gpio %d," + " can sleep\n", mi->output_gpios[i]); + err = -EINVAL; + goto err_output_gpio_configure_failed; + } if (mi->flags & GPIOKPF_DRIVE_INACTIVE) err = gpio_direction_output(mi->output_gpios[i], !(mi->flags & GPIOKPF_ACTIVE_HIGH)); |