diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2012-07-13 13:04:00 +0100 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2012-07-14 09:42:57 +0100 |
commit | 165d0c52fe87f8a95fcc01391432a659915bd332 (patch) | |
tree | c31131804c5e7b3a81020ef52b6d3dbcc1140402 /drivers/staging/iio | |
parent | 79d2a6bd14b117f140817b7d258a54bb5c963473 (diff) |
staging:iio:lpc32xx_adc: 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: Roland Stigge <stigge@antcom.de>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/staging/iio')
-rw-r--r-- | drivers/staging/iio/adc/lpc32xx_adc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/iio/adc/lpc32xx_adc.c b/drivers/staging/iio/adc/lpc32xx_adc.c index 9690306d1f8f..348d051fc2f8 100644 --- a/drivers/staging/iio/adc/lpc32xx_adc.c +++ b/drivers/staging/iio/adc/lpc32xx_adc.c @@ -196,7 +196,7 @@ static int __devinit lpc32xx_adc_probe(struct platform_device *pdev) return 0; errout5: - free_irq(irq, iodev); + free_irq(irq, info); errout4: clk_put(info->clk); errout3: @@ -214,7 +214,7 @@ static int __devexit lpc32xx_adc_remove(struct platform_device *pdev) int irq = platform_get_irq(pdev, 0); iio_device_unregister(iodev); - free_irq(irq, iodev); + free_irq(irq, info); platform_set_drvdata(pdev, NULL); clk_put(info->clk); iounmap(info->adc_base); |