]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
pata_arasan_cf: fix IRQ check
authorSergey Shtylyov <s.shtylyov@omprussia.ru>
Thu, 25 Mar 2021 20:50:24 +0000 (23:50 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 14 May 2021 08:49:54 +0000 (10:49 +0200)
commit30c1aaf32017de4f85b9f84be4eb7a4b4bf52f56
tree8e8fe97a6b79a1323cf577f6abf391713a312064
parenta6becc3db95cf0e0b1db26fa1f44cfd114ab1291
pata_arasan_cf: fix IRQ check

[ Upstream commit c7e8f404d56b99c80990b19a402c3f640d74be05 ]

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 upstream
-EPROBE_DEFER, and set up the driver to polling mode on (negative) errors
and IRQ0 (libata treats IRQ #0 as a polling mode anyway)...

Fixes: a480167b23ef ("pata_arasan_cf: Adding support for arasan compact flash host controller")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omprussia.ru>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/ata/pata_arasan_cf.c