summaryrefslogtreecommitdiffstats
path: root/drivers/media/rc/fintek-cir.c
diff options
context:
space:
mode:
authorLuis Henriques <luis.henriques@canonical.com>2012-04-21 12:25:21 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-04-26 15:41:16 -0300
commit9ef449c6b31bb6a8e6dedc24de475a3b8c79be20 (patch)
tree03b61f0a0288416b83063099c15be28eead02ebe /drivers/media/rc/fintek-cir.c
parent9967232f1be5bab10c7b7a8dcf51ff5c3c1a6d77 (diff)
downloadop-kernel-dev-9ef449c6b31bb6a8e6dedc24de475a3b8c79be20.zip
op-kernel-dev-9ef449c6b31bb6a8e6dedc24de475a3b8c79be20.tar.gz
[media] rc: Postpone ISR registration
An early registration of an ISR was causing a crash to several users (for example, with the ite-cir driver: http://bugs.launchpad.net/bugs/972723). The reason was that IRQs were being triggered before a driver initialisation was completed. This patch fixes this by moving the invocation to request_irq() and to request_region() to a later stage on the driver probe function. Cc: <stable@vger.kernel.org> Signed-off-by: Luis Henriques <luis.henriques@canonical.com> Acked-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/rc/fintek-cir.c')
-rw-r--r--drivers/media/rc/fintek-cir.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/media/rc/fintek-cir.c b/drivers/media/rc/fintek-cir.c
index 392d4be..238d403 100644
--- a/drivers/media/rc/fintek-cir.c
+++ b/drivers/media/rc/fintek-cir.c
@@ -514,16 +514,6 @@ static int fintek_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id
spin_lock_init(&fintek->fintek_lock);
- ret = -EBUSY;
- /* now claim resources */
- if (!request_region(fintek->cir_addr,
- fintek->cir_port_len, FINTEK_DRIVER_NAME))
- goto failure;
-
- if (request_irq(fintek->cir_irq, fintek_cir_isr, IRQF_SHARED,
- FINTEK_DRIVER_NAME, (void *)fintek))
- goto failure;
-
pnp_set_drvdata(pdev, fintek);
fintek->pdev = pdev;
@@ -558,6 +548,16 @@ static int fintek_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id
/* rx resolution is hardwired to 50us atm, 1, 25, 100 also possible */
rdev->rx_resolution = US_TO_NS(CIR_SAMPLE_PERIOD);
+ ret = -EBUSY;
+ /* now claim resources */
+ if (!request_region(fintek->cir_addr,
+ fintek->cir_port_len, FINTEK_DRIVER_NAME))
+ goto failure;
+
+ if (request_irq(fintek->cir_irq, fintek_cir_isr, IRQF_SHARED,
+ FINTEK_DRIVER_NAME, (void *)fintek))
+ goto failure;
+
ret = rc_register_device(rdev);
if (ret)
goto failure;
OpenPOWER on IntegriCloud