Skip to content

Commit

Permalink
sata_highbank: fix deferred probing
Browse files Browse the repository at this point in the history
[ Upstream commit 4a24efa ]

The driver overrides the error codes returned by platform_get_irq() to
-EINVAL, so if it returns -EPROBE_DEFER, the driver would fail the probe
permanently instead of the deferred probing. Switch to propagating the
error code upstream, still checking/overriding IRQ0 as libata regards it
as "no IRQ" (thus polling) anyway...

Fixes: 9ec36ca ("of/irq: do irq resolution in platform_get_irq")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omprussia.ru>
Link: https://lore.kernel.org/r/105b456d-1199-f6e9-ceb7-ffc5ba551d1a@omprussia.ru
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Sergey Shtylyov authored and gregkh committed Jul 14, 2021
1 parent 2d36507 commit 076081f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/ata/sata_highbank.c
Original file line number Diff line number Diff line change
Expand Up @@ -469,10 +469,12 @@ static int ahci_highbank_probe(struct platform_device *pdev)
}

irq = platform_get_irq(pdev, 0);
if (irq <= 0) {
if (irq < 0) {
dev_err(dev, "no irq\n");
return -EINVAL;
return irq;
}
if (!irq)
return -EINVAL;

hpriv = devm_kzalloc(dev, sizeof(*hpriv), GFP_KERNEL);
if (!hpriv) {
Expand Down

0 comments on commit 076081f

Please sign in to comment.