pata_ipx4xx_cf: fix IRQ check
authorSergey Shtylyov <s.shtylyov@omprussia.ru>
Thu, 25 Mar 2021 20:51:10 +0000 (23:51 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 22 May 2021 08:40:25 +0000 (10:40 +0200)
commitee3fa23f36b0d5f976297b5646961ac284e0c749
tree13414c8ab72f86dbeb14e0579e8f00c2e5be7155
parent4199e48f95421fe912b9bd01aee572b613d0fb7f
pata_ipx4xx_cf: fix IRQ check

[ Upstream commit e379b40cc0f179403ce0b82b7e539f635a568da5 ]

The driver's probe() method is written as if platform_get_irq() returns 0
on error, while actually it returns a negative error code (with all the
other values considered valid IRQs).  Rewrite the driver's IRQ checking
code to pass the positive IRQ #s to ata_host_activate(), propagate errors
upstream, and treat IRQ0 as error, returning -EINVAL, as the libata code
treats 0  as  an indication that polling should be used anyway...

Fixes: 0df0d0a0ea9f ("[libata] ARM: add ixp4xx PATA driver")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omprussia.ru>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/ata/pata_ixp4xx_cf.c