Received: by 10.192.165.156 with SMTP id m28csp1223354imm; Wed, 11 Apr 2018 14:58:50 -0700 (PDT) X-Google-Smtp-Source: AIpwx49YVoCv8It0XVmqqO7wemdEvwoueJYguc2Bom1it/FLquz4FCJG+E04+CsjCmHI6XMGvhSB X-Received: by 10.99.55.68 with SMTP id g4mr4526563pgn.283.1523483930723; Wed, 11 Apr 2018 14:58:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523483930; cv=none; d=google.com; s=arc-20160816; b=sj+5kV3k84U6ufa/1zsZm/WIGNLIHHXw4iDCrdc8oqW1uTX+77rf4o1aotqtmNgD+d I/WRu0010JOATr7JlTT9vHiDWybardgY/gIQrtEc8IdFcZRphNh+UCr+unWatziYO2D6 weEx+b0CYhxkwO+fHMDC1KzT/lqpVPudm86MPV+AhktkRgRHNEeJP60x8JwVOiglCmow 3UvU9kXwanVcvwbRToIee3YkOD6j5HhA+TXKCiyBlxDquOaQnn6jB6WsKXmNv6Cmzjxh TBhB1g09VcEMHUpb93olE7YQ10vwccZmDF2rFY2VE7b/Vmv9/2ahQ5zYS7k7iw83iqAL HkVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=c3XAMUenoz41o8kga/o7WTj74CYqTEoV+qxxrXo9sB4=; b=rwyYgglESvg9dxsiAzZrlRwxCV6dx1vdg0Tc1mXI05/3vSfEh2s6Hd0AnKs5eGYaLw kdXebNiJxnl1tzB9OCkXTZp1+H5KLGFP1GWfdkUxZd/ObXT+egr6lkXJoY6DbbJmHeOW t9/1HziobTQExGbg5HOWC4e/kB87xZYWrdQsgl65c1YZV5sShHU1CPBoqdEzuqSYTbUV cDkAHK0YBx45O1YEEdFrDRYHEdIfXryCI96dPU6hHZqyphs6og0zQxt3WHDFgsrEA2RV W709U7wZDP4zF1RGollXOvlux/9GsJnePaSIZgerZQ0UjK+znyyP768mO6sRAnDCdcL+ Cnww== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i133si1320392pgd.598.2018.04.11.14.58.14; Wed, 11 Apr 2018 14:58:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757344AbeDKUHL (ORCPT + 99 others); Wed, 11 Apr 2018 16:07:11 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:34924 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933650AbeDKSzJ (ORCPT ); Wed, 11 Apr 2018 14:55:09 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 80E1BC06; Wed, 11 Apr 2018 18:55:08 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Thomas Petazzoni , Hans de Goede , Tejun Heo , Sasha Levin Subject: [PATCH 4.9 059/310] ata: libahci: properly propagate return value of platform_get_irq() Date: Wed, 11 Apr 2018 20:33:18 +0200 Message-Id: <20180411183624.775452151@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180411183622.305902791@linuxfoundation.org> References: <20180411183622.305902791@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Thomas Petazzoni [ 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 Reviewed-by: Hans de Goede Signed-off-by: Tejun Heo Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/ata/libahci_platform.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) --- a/drivers/ata/libahci_platform.c +++ b/drivers/ata/libahci_platform.c @@ -514,8 +514,9 @@ int ahci_platform_init_host(struct platf 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; } hpriv->irq = irq;