diff options
author | Luis Henriques <luis.henriques@canonical.com> | 2012-04-21 11:25:21 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-04-26 14:41:16 -0400 |
commit | 9ef449c6b31bb6a8e6dedc24de475a3b8c79be20 (patch) | |
tree | 03b61f0a0288416b83063099c15be28eead02ebe /drivers/media/rc/ite-cir.c | |
parent | 9967232f1be5bab10c7b7a8dcf51ff5c3c1a6d77 (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/ite-cir.c')
-rw-r--r-- | drivers/media/rc/ite-cir.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/media/rc/ite-cir.c b/drivers/media/rc/ite-cir.c index 682009d76cd..0e49c99abf6 100644 --- a/drivers/media/rc/ite-cir.c +++ b/drivers/media/rc/ite-cir.c | |||
@@ -1515,16 +1515,6 @@ static int ite_probe(struct pnp_dev *pdev, const struct pnp_device_id | |||
1515 | /* initialize raw event */ | 1515 | /* initialize raw event */ |
1516 | init_ir_raw_event(&itdev->rawir); | 1516 | init_ir_raw_event(&itdev->rawir); |
1517 | 1517 | ||
1518 | ret = -EBUSY; | ||
1519 | /* now claim resources */ | ||
1520 | if (!request_region(itdev->cir_addr, | ||
1521 | dev_desc->io_region_size, ITE_DRIVER_NAME)) | ||
1522 | goto failure; | ||
1523 | |||
1524 | if (request_irq(itdev->cir_irq, ite_cir_isr, IRQF_SHARED, | ||
1525 | ITE_DRIVER_NAME, (void *)itdev)) | ||
1526 | goto failure; | ||
1527 | |||
1528 | /* set driver data into the pnp device */ | 1518 | /* set driver data into the pnp device */ |
1529 | pnp_set_drvdata(pdev, itdev); | 1519 | pnp_set_drvdata(pdev, itdev); |
1530 | itdev->pdev = pdev; | 1520 | itdev->pdev = pdev; |
@@ -1600,6 +1590,16 @@ static int ite_probe(struct pnp_dev *pdev, const struct pnp_device_id | |||
1600 | rdev->driver_name = ITE_DRIVER_NAME; | 1590 | rdev->driver_name = ITE_DRIVER_NAME; |
1601 | rdev->map_name = RC_MAP_RC6_MCE; | 1591 | rdev->map_name = RC_MAP_RC6_MCE; |
1602 | 1592 | ||
1593 | ret = -EBUSY; | ||
1594 | /* now claim resources */ | ||
1595 | if (!request_region(itdev->cir_addr, | ||
1596 | dev_desc->io_region_size, ITE_DRIVER_NAME)) | ||
1597 | goto failure; | ||
1598 | |||
1599 | if (request_irq(itdev->cir_irq, ite_cir_isr, IRQF_SHARED, | ||
1600 | ITE_DRIVER_NAME, (void *)itdev)) | ||
1601 | goto failure; | ||
1602 | |||
1603 | ret = rc_register_device(rdev); | 1603 | ret = rc_register_device(rdev); |
1604 | if (ret) | 1604 | if (ret) |
1605 | goto failure; | 1605 | goto failure; |