aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/i2c
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2015-01-23 10:52:20 -0500
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-02-02 08:15:03 -0500
commitfa5721d159bb1da086d85c34f358282d4ae07093 (patch)
treee892fb709b6fce3f819280c9598913820bcc9ee3 /drivers/media/i2c
parent24692801a4d03dabb64e38b10d089beb3710be9d (diff)
[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: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Federico Vaga <federico.vaga@gmail.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/i2c')
-rw-r--r--drivers/media/i2c/adv7180.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/media/i2c/adv7180.c b/drivers/media/i2c/adv7180.c
index 94a3341b091b..7666d10d3f16 100644
--- a/drivers/media/i2c/adv7180.c
+++ b/drivers/media/i2c/adv7180.c
@@ -553,11 +553,6 @@ static int init_device(struct i2c_client *client, struct adv7180_state *state)
553 553
554 /* register for interrupts */ 554 /* register for interrupts */
555 if (state->irq > 0) { 555 if (state->irq > 0) {
556 ret = request_threaded_irq(state->irq, NULL, adv7180_irq,
557 IRQF_ONESHOT, KBUILD_MODNAME, state);
558 if (ret)
559 return ret;
560
561 ret = i2c_smbus_write_byte_data(client, ADV7180_ADI_CTRL_REG, 556 ret = i2c_smbus_write_byte_data(client, ADV7180_ADI_CTRL_REG,
562 ADV7180_ADI_CTRL_IRQ_SPACE); 557 ADV7180_ADI_CTRL_IRQ_SPACE);
563 if (ret < 0) 558 if (ret < 0)
@@ -597,7 +592,6 @@ static int init_device(struct i2c_client *client, struct adv7180_state *state)
597 return 0; 592 return 0;
598 593
599err: 594err:
600 free_irq(state->irq, state);
601 return ret; 595 return ret;
602} 596}
603 597
@@ -634,6 +628,13 @@ static int adv7180_probe(struct i2c_client *client,
634 if (ret) 628 if (ret)
635 goto err_free_ctrl; 629 goto err_free_ctrl;
636 630
631 if (state->irq) {
632 ret = request_threaded_irq(client->irq, NULL, adv7180_irq,
633 IRQF_ONESHOT, KBUILD_MODNAME, state);
634 if (ret)
635 goto err_free_ctrl;
636 }
637
637 ret = v4l2_async_register_subdev(sd); 638 ret = v4l2_async_register_subdev(sd);
638 if (ret) 639 if (ret)
639 goto err_free_irq; 640 goto err_free_irq;