diff options
author | Ben Hutchings <ben@decadent.org.uk> | 2011-11-16 01:54:04 -0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-03-12 12:31:39 -0700 |
commit | d6bc69349915e2d58499165851a17280c97126ac (patch) | |
tree | 9ff7de81f4fdf11e28fa596cc63c9c7d57abbec0 /drivers | |
parent | 47cd23fd083012c8f11a93be0af485d5f2358491 (diff) |
media: staging: lirc_serial: Do not assume error codes returned by request_irq()
commit affc9a0d59ac49bd304e2137bd5e4ffdd6fdfa52 upstream.
lirc_serial_probe() must fail if request_irq() returns an error, even if
it isn't EBUSY or EINVAL,
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/media/lirc/lirc_serial.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/drivers/staging/media/lirc/lirc_serial.c b/drivers/staging/media/lirc/lirc_serial.c index befe6267d7c..1501e4e74ec 100644 --- a/drivers/staging/media/lirc/lirc_serial.c +++ b/drivers/staging/media/lirc/lirc_serial.c @@ -843,18 +843,15 @@ static int __devinit lirc_serial_probe(struct platform_device *dev) result = request_irq(irq, irq_handler, (share_irq ? IRQF_SHARED : 0), LIRC_DRIVER_NAME, (void *)&hardware); - - switch (result) { - case -EBUSY: - printk(KERN_ERR LIRC_DRIVER_NAME ": IRQ %d busy\n", irq); - return -EBUSY; - case -EINVAL: - printk(KERN_ERR LIRC_DRIVER_NAME - ": Bad irq number or handler\n"); - return -EINVAL; - default: - break; - }; + if (result < 0) { + if (result == -EBUSY) + printk(KERN_ERR LIRC_DRIVER_NAME ": IRQ %d busy\n", + irq); + else if (result == -EINVAL) + printk(KERN_ERR LIRC_DRIVER_NAME + ": Bad irq number or handler\n"); + return result; + } /* Reserve io region. */ /* |