summaryrefslogtreecommitdiffstats
path: root/drivers/staging/iio
diff options
context:
space:
mode:
authorHartmut Knaack <knaack.h@gmx.de>2014-01-01 23:04:00 +0000
committerJonathan Cameron <jic23@kernel.org>2014-02-15 09:51:43 +0000
commitcc7c0f7e078a19da3d50fb9ecb7b34d01fd521d2 (patch)
tree2516a16c194d73b644ab8f52cb9aaec073f31cd6 /drivers/staging/iio
parenta37d70eb655fdcbcd93b053d11b569cc7b1787eb (diff)
downloadblackbird-obmc-linux-cc7c0f7e078a19da3d50fb9ecb7b34d01fd521d2.tar.gz
blackbird-obmc-linux-cc7c0f7e078a19da3d50fb9ecb7b34d01fd521d2.zip
staging:iio:ad799x Move to devm_request_threaded_irq to make device-removal simpler.
Signed-off-by: Hartmut Knaack <knaack.h@gmx.de> Acked-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/ad799x_core.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/drivers/staging/iio/adc/ad799x_core.c b/drivers/staging/iio/adc/ad799x_core.c
index 5708ffc62aec..9c8013c28824 100644
--- a/drivers/staging/iio/adc/ad799x_core.c
+++ b/drivers/staging/iio/adc/ad799x_core.c
@@ -577,25 +577,23 @@ static int ad799x_probe(struct i2c_client *client,
goto error_disable_reg;
if (client->irq > 0) {
- ret = request_threaded_irq(client->irq,
- NULL,
- ad799x_event_handler,
- IRQF_TRIGGER_FALLING |
- IRQF_ONESHOT,
- client->name,
- indio_dev);
+ ret = devm_request_threaded_irq(&client->dev,
+ client->irq,
+ NULL,
+ ad799x_event_handler,
+ IRQF_TRIGGER_FALLING |
+ IRQF_ONESHOT,
+ client->name,
+ indio_dev);
if (ret)
goto error_cleanup_ring;
}
ret = iio_device_register(indio_dev);
if (ret)
- goto error_free_irq;
+ goto error_cleanup_ring;
return 0;
-error_free_irq:
- if (client->irq > 0)
- free_irq(client->irq, indio_dev);
error_cleanup_ring:
ad799x_ring_cleanup(indio_dev);
error_disable_reg:
@@ -611,8 +609,6 @@ static int ad799x_remove(struct i2c_client *client)
struct ad799x_state *st = iio_priv(indio_dev);
iio_device_unregister(indio_dev);
- if (client->irq > 0)
- free_irq(client->irq, indio_dev);
ad799x_ring_cleanup(indio_dev);
if (!IS_ERR(st->reg))
OpenPOWER on IntegriCloud