Commit cc7c0f7e authored by Hartmut Knaack's avatar Hartmut Knaack Committed by Jonathan Cameron

staging:iio:ad799x Move to devm_request_threaded_irq to make device-removal simpler.

Signed-off-by: default avatarHartmut Knaack <knaack.h@gmx.de>
Acked-by: default avatarLars-Peter Clausen <lars@metafoo.de>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent a37d70eb
...@@ -577,25 +577,23 @@ static int ad799x_probe(struct i2c_client *client, ...@@ -577,25 +577,23 @@ static int ad799x_probe(struct i2c_client *client,
goto error_disable_reg; goto error_disable_reg;
if (client->irq > 0) { if (client->irq > 0) {
ret = request_threaded_irq(client->irq, ret = devm_request_threaded_irq(&client->dev,
NULL, client->irq,
ad799x_event_handler, NULL,
IRQF_TRIGGER_FALLING | ad799x_event_handler,
IRQF_ONESHOT, IRQF_TRIGGER_FALLING |
client->name, IRQF_ONESHOT,
indio_dev); client->name,
indio_dev);
if (ret) if (ret)
goto error_cleanup_ring; goto error_cleanup_ring;
} }
ret = iio_device_register(indio_dev); ret = iio_device_register(indio_dev);
if (ret) if (ret)
goto error_free_irq; goto error_cleanup_ring;
return 0; return 0;
error_free_irq:
if (client->irq > 0)
free_irq(client->irq, indio_dev);
error_cleanup_ring: error_cleanup_ring:
ad799x_ring_cleanup(indio_dev); ad799x_ring_cleanup(indio_dev);
error_disable_reg: error_disable_reg:
...@@ -611,8 +609,6 @@ static int ad799x_remove(struct i2c_client *client) ...@@ -611,8 +609,6 @@ static int ad799x_remove(struct i2c_client *client)
struct ad799x_state *st = iio_priv(indio_dev); struct ad799x_state *st = iio_priv(indio_dev);
iio_device_unregister(indio_dev); iio_device_unregister(indio_dev);
if (client->irq > 0)
free_irq(client->irq, indio_dev);
ad799x_ring_cleanup(indio_dev); ad799x_ring_cleanup(indio_dev);
if (!IS_ERR(st->reg)) if (!IS_ERR(st->reg))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment