Commit fa5721d1 authored by Lars-Peter Clausen's avatar Lars-Peter Clausen Committed by Mauro Carvalho Chehab

[media] adv7180: Do not request the IRQ again during resume

Currently the IRQ is requested from within the init_device() function. This
function is not only called during device probe, but also during resume
causing the driver to try to request the IRQ again. Move requesting the IRQ
from init_device() to the probe function to make sure that it is only
requested once.
Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
Acked-by: default avatarFederico Vaga <federico.vaga@gmail.com>
Acked-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 24692801
...@@ -553,11 +553,6 @@ static int init_device(struct i2c_client *client, struct adv7180_state *state) ...@@ -553,11 +553,6 @@ static int init_device(struct i2c_client *client, struct adv7180_state *state)
/* register for interrupts */ /* register for interrupts */
if (state->irq > 0) { if (state->irq > 0) {
ret = request_threaded_irq(state->irq, NULL, adv7180_irq,
IRQF_ONESHOT, KBUILD_MODNAME, state);
if (ret)
return ret;
ret = i2c_smbus_write_byte_data(client, ADV7180_ADI_CTRL_REG, ret = i2c_smbus_write_byte_data(client, ADV7180_ADI_CTRL_REG,
ADV7180_ADI_CTRL_IRQ_SPACE); ADV7180_ADI_CTRL_IRQ_SPACE);
if (ret < 0) if (ret < 0)
...@@ -597,7 +592,6 @@ static int init_device(struct i2c_client *client, struct adv7180_state *state) ...@@ -597,7 +592,6 @@ static int init_device(struct i2c_client *client, struct adv7180_state *state)
return 0; return 0;
err: err:
free_irq(state->irq, state);
return ret; return ret;
} }
...@@ -634,6 +628,13 @@ static int adv7180_probe(struct i2c_client *client, ...@@ -634,6 +628,13 @@ static int adv7180_probe(struct i2c_client *client,
if (ret) if (ret)
goto err_free_ctrl; goto err_free_ctrl;
if (state->irq) {
ret = request_threaded_irq(client->irq, NULL, adv7180_irq,
IRQF_ONESHOT, KBUILD_MODNAME, state);
if (ret)
goto err_free_ctrl;
}
ret = v4l2_async_register_subdev(sd); ret = v4l2_async_register_subdev(sd);
if (ret) if (ret)
goto err_free_irq; goto err_free_irq;
......
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