ptp: ixp46x: remove NO_IRQ handling
Subsystems (3)
PATCH 1/1 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.
--- drivers/ptp/ptp_ixp46x.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-)
drivers/ptp/ptp_ixp46x.c +8 -7
@@ -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;
Signature · 1 line
2.9.0
Quoted 8 lines · Arnd Bergmann
gpio_to_irqdoes not returnNO_IRQbut instead returns a negative error code on failure. ReturningNO_IRQfrom 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 removeNO_IRQfrom the kernel entirely.Signed-off-by Arnd Bergmann <[email protected]>
Quoted 11 lines · CEST Richard Cochran
Quoted 8 lines · Arnd Bergmann
gpio_to_irqdoes not returnNO_IRQbut instead returns a negative error code on failure. ReturningNO_IRQfrom 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 removeNO_IRQfrom the kernel entirely.Signed-off-by Arnd Bergmann <[email protected]>Acked-by Richard Cochran <[email protected]>
Thanks!
I just realized that the randconfig builder had not picked up this one and there was a typo. I'll send a replacement patch with your Ack added in.
Arnd