[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>
This commit is contained in:

committed by
Mauro Carvalho Chehab

parent
9967232f1b
commit
9ef449c6b3
@@ -1515,16 +1515,6 @@ static int ite_probe(struct pnp_dev *pdev, const struct pnp_device_id
|
||||
/* initialize raw event */
|
||||
init_ir_raw_event(&itdev->rawir);
|
||||
|
||||
ret = -EBUSY;
|
||||
/* now claim resources */
|
||||
if (!request_region(itdev->cir_addr,
|
||||
dev_desc->io_region_size, ITE_DRIVER_NAME))
|
||||
goto failure;
|
||||
|
||||
if (request_irq(itdev->cir_irq, ite_cir_isr, IRQF_SHARED,
|
||||
ITE_DRIVER_NAME, (void *)itdev))
|
||||
goto failure;
|
||||
|
||||
/* set driver data into the pnp device */
|
||||
pnp_set_drvdata(pdev, itdev);
|
||||
itdev->pdev = pdev;
|
||||
@@ -1600,6 +1590,16 @@ static int ite_probe(struct pnp_dev *pdev, const struct pnp_device_id
|
||||
rdev->driver_name = ITE_DRIVER_NAME;
|
||||
rdev->map_name = RC_MAP_RC6_MCE;
|
||||
|
||||
ret = -EBUSY;
|
||||
/* now claim resources */
|
||||
if (!request_region(itdev->cir_addr,
|
||||
dev_desc->io_region_size, ITE_DRIVER_NAME))
|
||||
goto failure;
|
||||
|
||||
if (request_irq(itdev->cir_irq, ite_cir_isr, IRQF_SHARED,
|
||||
ITE_DRIVER_NAME, (void *)itdev))
|
||||
goto failure;
|
||||
|
||||
ret = rc_register_device(rdev);
|
||||
if (ret)
|
||||
goto failure;
|
||||
|
Reference in New Issue
Block a user