summaryrefslogtreecommitdiff
path: root/drivers/ata
diff options
context:
space:
mode:
authorSergey Shtylyov <s.shtylyov@omprussia.ru>2021-03-25 23:51:10 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-05-14 09:44:24 +0200
commit782ec39b37bdbdecb3a7f12ba58b21ae232e2873 (patch)
treec3c0c7f7845814019bbbaf917b1854fe2ae94007 /drivers/ata
parentaf9c0391353dcb6fc75beb6b720c782103b1bfaa (diff)
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>
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/pata_ixp4xx_cf.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/ata/pata_ixp4xx_cf.c b/drivers/ata/pata_ixp4xx_cf.c
index d1644a8ef9fa..abc0e87ca1a8 100644
--- a/drivers/ata/pata_ixp4xx_cf.c
+++ b/drivers/ata/pata_ixp4xx_cf.c
@@ -165,8 +165,12 @@ static int ixp4xx_pata_probe(struct platform_device *pdev)
return -ENOMEM;
irq = platform_get_irq(pdev, 0);
- if (irq)
+ if (irq > 0)
irq_set_irq_type(irq, IRQ_TYPE_EDGE_RISING);
+ else if (irq < 0)
+ return irq;
+ else
+ return -EINVAL;
/* Setup expansion bus chip selects */
*data->cs0_cfg = data->cs0_bits;