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

pata_octeon_cf: avoid WARN_ON() in ata_host_activate()

Iff platform_get_irq() fails (or returns IRQ0) and thus the polling mode
has to be used, ata_host_activate() hits the WARN_ON() due to 'irq_handler'
parameter being non-NULL if the polling mode is selected. Let's only set
the pointer to the driver's IRQ handler if platform_get_irq() returns a
valid IRQ # -- this should avoid the unnecessary WARN_ON()...

Fixes: 43f01da0f279 ("MIPS/OCTEON/ata: Convert pata_octeon_cf.c to use device tree.")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Link: https://lore.kernel.org/r/3a241167-f84d-1d25-5b9b-be910afbe666@omp.ru
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Sergey Shtylyov and committed by
Jens Axboe
bfc1f378 2d3a62fb

+3 -2
+3 -2
drivers/ata/pata_octeon_cf.c
··· 898 898 return -EINVAL; 899 899 } 900 900 901 - irq_handler = octeon_cf_interrupt; 902 901 i = platform_get_irq(dma_dev, 0); 903 - if (i > 0) 902 + if (i > 0) { 904 903 irq = i; 904 + irq_handler = octeon_cf_interrupt; 905 + } 905 906 } 906 907 of_node_put(dma_node); 907 908 }