lkml.org 
[lkml]   [2018]   [Mar]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH AUTOSEL for 3.18 027/102] ata: libahci: properly propagate return value of platform_get_irq()
    Date
    From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

    [ Upstream commit c034640a32f8456018d9c8c83799ead683046b95 ]

    When platform_get_irq() fails, it returns an error code, which
    libahci_platform and replaces it by -EINVAL. This commit fixes that by
    propagating the error code. It fixes the situation where
    platform_get_irq() returns -EPROBE_DEFER because the interrupt
    controller is not available yet, and generally looks like the right
    thing to do.

    We pay attention to not show the "no irq" message when we are in an
    EPROBE_DEFER situation, because the driver probing will be retried
    later on, once the interrupt controller becomes available to provide
    the interrupt.

    Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
    Reviewed-by: Hans de Goede <hdegoede@redhat.com>
    Signed-off-by: Tejun Heo <tj@kernel.org>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    ---
    drivers/ata/libahci_platform.c | 5 +++--
    1 file changed, 3 insertions(+), 2 deletions(-)

    diff --git a/drivers/ata/libahci_platform.c b/drivers/ata/libahci_platform.c
    index 0b03f9056692..94249ceb99f0 100644
    --- a/drivers/ata/libahci_platform.c
    +++ b/drivers/ata/libahci_platform.c
    @@ -419,8 +419,9 @@ int ahci_platform_init_host(struct platform_device *pdev,

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

    /* prepare host */
    --
    2.14.1
    \
     
     \ /
      Last update: 2018-03-19 17:46    [W:4.082 / U:0.060 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site