[lkml]   [2014]   [Mar]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
SubjectRe: [PATCH 2/3] gpio: dwapb: do not create the irq mapping upfront.
* Linus Walleij | 2014-03-25 21:43:49 [+0100]:

>> I looked at
>> those two links and you quote gpio_to_irq() which is not required.
>In a *lot* of drivers it is implicitly required that gpio_to_irq()
>is called first because they only call irq_create_mapping()
>there. (And not in subsequent interrupt handlers etc.)


--- a/drivers/gpio/gpio-dwapb.c
+++ b/drivers/gpio/gpio-dwapb.c
@@ -68,7 +68,7 @@ static int dwapb_gpio_to_irq(struct gpio_chip *gc, unsigned offset)
dwapb_gpio_port, bgc);
struct dwapb_gpio *gpio = port->gpio;

- return irq_find_mapping(gpio->domain, offset);
+ return irq_create_mapping(gpio->domain, offset);

static void dwapb_toggle_trigger(struct dwapb_gpio *gpio, unsigned int offs)
would fix the problem then. That means you get the gpio number passed as
a value and you plan to use it as an irq via gpio_to_irq() and the
latter will create the interrupt mapping then.

>No matter what, I would worry less about that and spend
>some time on using my new gpiolib helpers for
>gpiochip_irqchip_add() and
>Linus Walleij


 \ /
  Last update: 2014-03-25 22:21    [W:0.410 / U:0.348 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site