aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/rc/fintek-cir.c
diff options
context:
space:
mode:
authorLuis Henriques <luis.henriques@canonical.com>2012-04-21 11:25:21 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-04-26 14:41:16 -0400
commit9ef449c6b31bb6a8e6dedc24de475a3b8c79be20 (patch)
tree03b61f0a0288416b83063099c15be28eead02ebe /drivers/media/rc/fintek-cir.c
parent9967232f1be5bab10c7b7a8dcf51ff5c3c1a6d77 (diff)
[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 392d4be91f8f..238d4033a826 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
514 514
515 spin_lock_init(&fintek->fintek_lock); 515 spin_lock_init(&fintek->fintek_lock);
516 516
517 ret = -EBUSY;
518 /* now claim resources */
519 if (!request_region(fintek->cir_addr,
520 fintek->cir_port_len, FINTEK_DRIVER_NAME))
521 goto failure;
522
523 if (request_irq(fintek->cir_irq, fintek_cir_isr, IRQF_SHARED,
524 FINTEK_DRIVER_NAME, (void *)fintek))
525 goto failure;
526
527 pnp_set_drvdata(pdev, fintek); 517 pnp_set_drvdata(pdev, fintek);
528 fintek->pdev = pdev; 518 fintek->pdev = pdev;
529 519
@@ -558,6 +548,16 @@ static int fintek_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id
558 /* rx resolution is hardwired to 50us atm, 1, 25, 100 also possible */ 548 /* rx resolution is hardwired to 50us atm, 1, 25, 100 also possible */
559 rdev->rx_resolution = US_TO_NS(CIR_SAMPLE_PERIOD); 549 rdev->rx_resolution = US_TO_NS(CIR_SAMPLE_PERIOD);
560 550
551 ret = -EBUSY;
552 /* now claim resources */
553 if (!request_region(fintek->cir_addr,
554 fintek->cir_port_len, FINTEK_DRIVER_NAME))
555 goto failure;
556
557 if (request_irq(fintek->cir_irq, fintek_cir_isr, IRQF_SHARED,
558 FINTEK_DRIVER_NAME, (void *)fintek))
559 goto failure;
560
561 ret = rc_register_device(rdev); 561 ret = rc_register_device(rdev);
562 if (ret) 562 if (ret)
563 goto failure; 563 goto failure;