lkml.org 
[lkml]   [2021]   [Jul]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.13 277/800] pata_rb532_cf: fix deferred probing
    Date
    From: Sergey Shtylyov <s.shtylyov@omprussia.ru>

    [ Upstream commit 2d3a62fbae8e5badc2342388f65ab2191c209cc0 ]

    The driver overrides the error codes returned by platform_get_irq() to
    -ENOENT, 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")
    Signed-off-by: Sergey Shtylyov <s.shtylyov@omprussia.ru>
    Link: https://lore.kernel.org/r/771ced55-3efb-21f5-f21c-b99920aae611@omprussia.ru
    Signed-off-by: Jens Axboe <axboe@kernel.dk>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    drivers/ata/pata_rb532_cf.c | 6 ++++--
    1 file changed, 4 insertions(+), 2 deletions(-)

    diff --git a/drivers/ata/pata_rb532_cf.c b/drivers/ata/pata_rb532_cf.c
    index 479c4b29b856..303f8c375b3a 100644
    --- a/drivers/ata/pata_rb532_cf.c
    +++ b/drivers/ata/pata_rb532_cf.c
    @@ -115,10 +115,12 @@ static int rb532_pata_driver_probe(struct platform_device *pdev)
    }

    irq = platform_get_irq(pdev, 0);
    - if (irq <= 0) {
    + if (irq < 0) {
    dev_err(&pdev->dev, "no IRQ resource found\n");
    - return -ENOENT;
    + return irq;
    }
    + if (!irq)
    + return -EINVAL;

    gpiod = devm_gpiod_get(&pdev->dev, NULL, GPIOD_IN);
    if (IS_ERR(gpiod)) {
    --
    2.30.2


    \
     
     \ /
      Last update: 2021-07-12 10:41    [W:4.456 / U:0.004 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site