Skip to content

Commit

Permalink
[media] staging: lirc_serial: Do not assume error codes returned by r…
Browse files Browse the repository at this point in the history
…equest_irq()

lirc_serial_probe() must fail if request_irq() returns an error, even if
it isn't EBUSY or EINVAL,

Signed-off-by: Ben Hutchings <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
bwhacks authored and Mauro Carvalho Chehab committed Nov 24, 2011
1 parent 9b98d60 commit affc9a0
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions drivers/staging/media/lirc/lirc_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
/*
Expand Down

0 comments on commit affc9a0

Please sign in to comment.