Commit fb730334 authored by Zheyu Ma's avatar Zheyu Ma Committed by Mauro Carvalho Chehab

media: tw686x: Register the irq at the end of probe

We got the following warning when booting the kernel:

[    3.243674] INFO: trying to register non-static key.
[    3.243922] The code is fine but needs lockdep annotation, or maybe
[    3.244230] you didn't initialize this object before use?
[    3.245642] Call Trace:
[    3.247836]  lock_acquire+0xff/0x2d0
[    3.248727]  tw686x_audio_irq+0x1a5/0xcc0 [tw686x]
[    3.249211]  tw686x_irq+0x1f9/0x480 [tw686x]

The lock 'vc->qlock' will be initialized in tw686x_video_init(), but the
driver registers the irq before calling the tw686x_video_init(), and we
got the warning.

Fix this by registering the irq at the end of probe

Fixes: 704a84cc ("[media] media: Support Intersil/Techwell TW686x-based video capture cards")
Signed-off-by: default avatarZheyu Ma <zheyuma97@gmail.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent d3741027
...@@ -315,13 +315,6 @@ static int tw686x_probe(struct pci_dev *pci_dev, ...@@ -315,13 +315,6 @@ static int tw686x_probe(struct pci_dev *pci_dev,
spin_lock_init(&dev->lock); spin_lock_init(&dev->lock);
err = request_irq(pci_dev->irq, tw686x_irq, IRQF_SHARED,
dev->name, dev);
if (err < 0) {
dev_err(&pci_dev->dev, "unable to request interrupt\n");
goto iounmap;
}
timer_setup(&dev->dma_delay_timer, tw686x_dma_delay, 0); timer_setup(&dev->dma_delay_timer, tw686x_dma_delay, 0);
/* /*
...@@ -333,18 +326,23 @@ static int tw686x_probe(struct pci_dev *pci_dev, ...@@ -333,18 +326,23 @@ static int tw686x_probe(struct pci_dev *pci_dev,
err = tw686x_video_init(dev); err = tw686x_video_init(dev);
if (err) { if (err) {
dev_err(&pci_dev->dev, "can't register video\n"); dev_err(&pci_dev->dev, "can't register video\n");
goto free_irq; goto iounmap;
} }
err = tw686x_audio_init(dev); err = tw686x_audio_init(dev);
if (err) if (err)
dev_warn(&pci_dev->dev, "can't register audio\n"); dev_warn(&pci_dev->dev, "can't register audio\n");
err = request_irq(pci_dev->irq, tw686x_irq, IRQF_SHARED,
dev->name, dev);
if (err < 0) {
dev_err(&pci_dev->dev, "unable to request interrupt\n");
goto iounmap;
}
pci_set_drvdata(pci_dev, dev); pci_set_drvdata(pci_dev, dev);
return 0; return 0;
free_irq:
free_irq(pci_dev->irq, dev);
iounmap: iounmap:
pci_iounmap(pci_dev, dev->mmio); pci_iounmap(pci_dev, dev->mmio);
free_region: free_region:
......
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