Skip to content

Commit

Permalink
ptp: ixp46x: remove NO_IRQ handling
Browse files Browse the repository at this point in the history
gpio_to_irq does not return NO_IRQ but instead returns a negative
error code on failure. Returning NO_IRQ from the function has no
negative effects as we only compare the result to the expected
interrupt number, but it's better to return a proper failure
code for consistency, and we should remove NO_IRQ from the kernel
entirely.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Arnd Bergmann authored and David S. Miller committed Sep 6, 2016
1 parent 72a31d8 commit cf86799
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions drivers/ptp/ptp_ixp46x.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,18 +268,19 @@ static int setup_interrupt(int gpio)
return err;

irq = gpio_to_irq(gpio);
if (irq < 0)
return irq;

if (NO_IRQ == irq)
return NO_IRQ;

if (irq_set_irq_type(irq, IRQF_TRIGGER_FALLING)) {
err = irq_set_irq_type(irq, IRQF_TRIGGER_FALLING);
if (err) {
pr_err("cannot set trigger type for irq %d\n", irq);
return NO_IRQ;
return err;
}

if (request_irq(irq, isr, 0, DRIVER, &ixp_clock)) {
err = request_irq(irq, isr, 0, DRIVER, &ixp_clock);
if (err) {
pr_err("request_irq failed for irq %d\n", irq);
return NO_IRQ;
return err;
}

return irq;
Expand Down

0 comments on commit cf86799

Please sign in to comment.