pata_octeon_cf: avoid WARN_ON() in ata_host_activate()
authorSergey Shtylyov <s.shtylyov@omp.ru>
Tue, 18 May 2021 20:38:54 +0000 (23:38 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Jul 2021 14:56:04 +0000 (16:56 +0200)
commit403577f75d5c433d056a67e61a042cb5ca86c730
tree5055553d75ea593e8fe3a374f7c6eb524f2abcba
parent5f9aaaaac816c249ce192f512daf86dc7fb0dddd
pata_octeon_cf: avoid WARN_ON() in ata_host_activate()

[ Upstream commit bfc1f378c8953e68ccdbfe0a8c20748427488b80 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/ata/pata_octeon_cf.c