Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ptp: ixp46x: remove NO_IRQ handling

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>

authored by

Arnd Bergmann and committed by
David S. Miller
cf86799e 72a31d85

+8 -7
+8 -7
drivers/ptp/ptp_ixp46x.c
··· 268 268 return err; 269 269 270 270 irq = gpio_to_irq(gpio); 271 + if (irq < 0) 272 + return irq; 271 273 272 - if (NO_IRQ == irq) 273 - return NO_IRQ; 274 - 275 - if (irq_set_irq_type(irq, IRQF_TRIGGER_FALLING)) { 274 + err = irq_set_irq_type(irq, IRQF_TRIGGER_FALLING); 275 + if (err) { 276 276 pr_err("cannot set trigger type for irq %d\n", irq); 277 - return NO_IRQ; 277 + return err; 278 278 } 279 279 280 - if (request_irq(irq, isr, 0, DRIVER, &ixp_clock)) { 280 + err = request_irq(irq, isr, 0, DRIVER, &ixp_clock); 281 + if (err) { 281 282 pr_err("request_irq failed for irq %d\n", irq); 282 - return NO_IRQ; 283 + return err; 283 284 } 284 285 285 286 return irq;