]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
sata_rcar: fix deferred probing
authorSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Sat, 24 Nov 2018 18:14:16 +0000 (21:14 +0300)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
BugLink: https://bugs.launchpad.net/bugs/1837664
[ Upstream commit 9f83cfdb1ace3ef268ecc6fda50058d2ec37d603 ]

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: 9ec36cafe43b ("of/irq: do irq resolution in platform_get_irq")
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/ata/sata_rcar.c

index 80ee2f2a50d02872a9b657e99d320ac7dfe2cc5a..d3045e5afe2993b31363f52624423659092142d9 100644 (file)
@@ -879,7 +879,9 @@ static int sata_rcar_probe(struct platform_device *pdev)
        int ret = 0;
 
        irq = platform_get_irq(pdev, 0);
-       if (irq <= 0)
+       if (irq < 0)
+               return irq;
+       if (!irq)
                return -EINVAL;
 
        priv = devm_kzalloc(&pdev->dev, sizeof(struct sata_rcar_priv),