summaryrefslogtreecommitdiff
path: root/drivers/input
diff options
context:
space:
mode:
authorLaxman Dewangan <ldewangan@nvidia.com>2014-04-24 10:15:18 +0530
committerSimone Willett <swillett@nvidia.com>2014-04-25 13:17:18 -0700
commit3d3975757f47b6cf933ae0bfba7b936992b7fd67 (patch)
tree47e5bf50cd14544d2617b56c85f67cf037c928ed /drivers/input
parentbad860e337a777045b176a357946336b276827e0 (diff)
input: gpio-keys: Allow invalid irq as -ve or zero
Allow to pass the invalid irq as -ve or zero from platform. For this change irq type on platform data as the integer type and handle in driver to treat -ve or zero irq as invalid irq. bug 1502787 Change-Id: I09f77dd6ef82f7668c940d31d620a588e9f35e7c Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: http://git-master/r/401200 Reviewed-by: Mitch Luban <mluban@nvidia.com> Tested-by: Mitch Luban <mluban@nvidia.com>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/keyboard/gpio_keys.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
index 58adba9cc871..78333db53db3 100644
--- a/drivers/input/keyboard/gpio_keys.c
+++ b/drivers/input/keyboard/gpio_keys.c
@@ -463,7 +463,7 @@ static int gpio_keys_setup_key(struct platform_device *pdev,
bdata->button = button;
spin_lock_init(&bdata->lock);
- if (gpio_is_valid(button->gpio) && !button->irq) {
+ if (gpio_is_valid(button->gpio) && (button->irq <= 0)) {
error = gpio_request_one(button->gpio, GPIOF_IN, desc);
if (error < 0) {
dev_err(dev, "Failed to request GPIO %d, error %d\n",
@@ -498,7 +498,7 @@ static int gpio_keys_setup_key(struct platform_device *pdev,
irqflags = IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING;
} else {
- if (!button->irq) {
+ if (button->irq <= 0) {
dev_err(dev, "No IRQ specified\n");
return -EINVAL;
}