From: Sergey Shtylyov Date: Tue, 18 May 2021 20:38:54 +0000 (+0300) Subject: pata_octeon_cf: avoid WARN_ON() in ata_host_activate() X-Git-Tag: accepted/tizen/unified/20230118.172025~7014^2~23 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bfc1f378c8953e68ccdbfe0a8c20748427488b80;p=platform%2Fkernel%2Flinux-rpi.git 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 Link: https://lore.kernel.org/r/3a241167-f84d-1d25-5b9b-be910afbe666@omp.ru Signed-off-by: Jens Axboe --- diff --git a/drivers/ata/pata_octeon_cf.c b/drivers/ata/pata_octeon_cf.c index bd87476..b5a3f71 100644 --- a/drivers/ata/pata_octeon_cf.c +++ b/drivers/ata/pata_octeon_cf.c @@ -898,10 +898,11 @@ static int octeon_cf_probe(struct platform_device *pdev) return -EINVAL; } - irq_handler = octeon_cf_interrupt; i = platform_get_irq(dma_dev, 0); - if (i > 0) + if (i > 0) { irq = i; + irq_handler = octeon_cf_interrupt; + } } of_node_put(dma_node); }