Skip to content

Commit 403577f

Browse files
Sergey Shtylyovgregkh
authored andcommitted
pata_octeon_cf: avoid WARN_ON() in ata_host_activate()
[ Upstream commit bfc1f37 ] 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: 43f01da ("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> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 5f9aaaa commit 403577f

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎drivers/ata/pata_octeon_cf.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -898,10 +898,11 @@ static int octeon_cf_probe(struct platform_device *pdev)
898898
return -EINVAL;
899899
}
900900

901-
irq_handler = octeon_cf_interrupt;
902901
i = platform_get_irq(dma_dev, 0);
903-
if (i > 0)
902+
if (i > 0) {
904903
irq = i;
904+
irq_handler = octeon_cf_interrupt;
905+
}
905906
}
906907
of_node_put(dma_node);
907908
}

0 commit comments

Comments
 (0)