]> git.karo-electronics.de Git - linux-beck.git/commit
staging:iio:tsl2x7x: Ensure request_irq and free_irq dev_id parameter match
authorLars-Peter Clausen <lars@metafoo.de>
Fri, 13 Jul 2012 12:04:00 +0000 (13:04 +0100)
committerJonathan Cameron <jic23@kernel.org>
Sat, 14 Jul 2012 08:42:57 +0000 (09:42 +0100)
commitd291d5f692f3fe90de08cea3f1c14ebd80da89ce
treee0f4cdc58e0c4922e2f211a37c8e45cd689f8485
parent165d0c52fe87f8a95fcc01391432a659915bd332
staging:iio:tsl2x7x: Ensure request_irq and free_irq dev_id parameter match

The data parameters for request_irq and free_irq have to match, otherwise the
IRQ wont be freed.

The issue has been discovered using the following coccinelle patch:

// <smpl>
@r1@
type T;
T data;
@@
(
request_irq(..., (void *)data)
|
request_irq(..., data)
|
request_threaded_irq(..., (void *)data)
|
request_threaded_irq(..., data)
)

@r2@
type r1.T;
T data;
position p;
@@
(
free_irq@p(..., (void *)data)
|
free_irq@p(..., data)
)

@depends on r1@
position p != r2.p;
@@
*free_irq@p(...)

// </smpl>

Cc: Jon Brenner <jbrenner@taosinc.com>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/staging/iio/light/tsl2x7x_core.c