lkml.org 
[lkml]   [2012]   [Jul]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 4/4] gpio/pca953x: register the device irq using appropriate api's
Date
From: Leed Aguilar <leed.aguilar@ti.com>

Here, the implementation of registration of requested IRQs has been corrected
with appropiate api's. The gpio number is requested through gpio_request_one()
API and conversion of the gpio to irq is done using the gpio_to_irq() API.

Change-Id: I964145e2a280d6553ea2c05ea8049810a1983930
Signed-off-by: Leed Aguilar <leed.aguilar@ti.com>
Signed-off-by: Chandrabhanu Mahapatra <cmahapatra@ti.com>
---
drivers/gpio/gpio-pca953x.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
index c3ca7d8..27486da 100644
--- a/drivers/gpio/gpio-pca953x.c
+++ b/drivers/gpio/gpio-pca953x.c
@@ -509,7 +509,13 @@ static int pca953x_irq_setup(struct pca953x_chip *chip,
#endif
}

- ret = request_threaded_irq(client->irq,
+ ret = gpio_request_one(client->irq, GPIOF_IN, "pca953x");
+ if (ret) {
+ dev_err(&client->dev, "gpio request failure\n");
+ goto out_failed;
+ }
+
+ ret = request_threaded_irq(gpio_to_irq(client->irq),
NULL,
pca953x_irq_handler,
IRQF_TRIGGER_LOW | IRQF_ONESHOT,
--
1.7.10


\
 
 \ /
  Last update: 2012-07-10 16:22    [W:0.107 / U:0.756 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site