From 1a7b6752652c3058fec7df79b00bc698cbae7b07 Mon Sep 17 00:00:00 2001 From: Anti Sullin Date: Wed, 26 Sep 2007 00:01:03 -0400 Subject: [PATCH] --- yaml --- r: 69367 b: refs/heads/master c: 006df3024431a50262d4a2898d25924f84fb697a h: refs/heads/master i: 69365: 95895b91c7a60f345e101613b76d819b9cc33f64 69363: c46a6b1de05fb5ab3975713191ff6b2753e8cb15 69359: 73647d5b4f70c50dc3d34e625446b7d1bcd7f439 v: v3 --- [refs] | 2 +- trunk/drivers/input/keyboard/gpio_keys.c | 29 ++++++++++++++++++------ 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/[refs] b/[refs] index 31e8ed73cbe0..b7b5436f0ac1 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 2a8281d72da5dd8da025e6822dadd23a35383895 +refs/heads/master: 006df3024431a50262d4a2898d25924f84fb697a diff --git a/trunk/drivers/input/keyboard/gpio_keys.c b/trunk/drivers/input/keyboard/gpio_keys.c index 739212252b09..b3069bc00f03 100644 --- a/trunk/drivers/input/keyboard/gpio_keys.c +++ b/trunk/drivers/input/keyboard/gpio_keys.c @@ -78,12 +78,24 @@ static int __devinit gpio_keys_probe(struct platform_device *pdev) int irq = gpio_to_irq(button->gpio); unsigned int type = button->type ?: EV_KEY; - set_irq_type(irq, IRQ_TYPE_EDGE_BOTH); - error = request_irq(irq, gpio_keys_isr, IRQF_SAMPLE_RANDOM, - button->desc ? button->desc : "gpio_keys", - pdev); + if (irq < 0) { + error = irq; + printk(KERN_ERR + "gpio-keys: " + "Unable to get irq number for GPIO %d," + "error %d\n", + button->gpio, error); + goto fail; + } + + error = request_irq(irq, gpio_keys_isr, + IRQF_SAMPLE_RANDOM | IRQF_TRIGGER_RISING | + IRQF_TRIGGER_FALLING, + button->desc ? button->desc : "gpio_keys", + pdev); if (error) { - printk(KERN_ERR "gpio-keys: unable to claim irq %d; error %d\n", + printk(KERN_ERR + "gpio-keys: Unable to claim irq %d; error %d\n", irq, error); goto fail; } @@ -93,16 +105,19 @@ static int __devinit gpio_keys_probe(struct platform_device *pdev) error = input_register_device(input); if (error) { - printk(KERN_ERR "Unable to register gpio-keys input device\n"); + printk(KERN_ERR + "gpio-keys: Unable to register input device, " + "error: %d\n", error); goto fail; } return 0; fail: - for (i = i - 1; i >= 0; i--) + while (--i >= 0) free_irq(gpio_to_irq(pdata->buttons[i].gpio), pdev); + platform_set_drvdata(pdev, NULL); input_free_device(input); return error;