Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp45551imu; Thu, 8 Nov 2018 14:29:40 -0800 (PST) X-Google-Smtp-Source: AJdET5db5skXll3Up44Ul9DjJsJa9jJzl8WRmaS/LEhgD1AzMctTVKCKbYs6NToMAgUSp3ws8Hof X-Received: by 2002:aa7:8546:: with SMTP id y6-v6mr6509017pfn.83.1541716180587; Thu, 08 Nov 2018 14:29:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541716180; cv=none; d=google.com; s=arc-20160816; b=W/mIavVMlviixDP+B7jMZS/z6PexBK7YG52NuTekOdquU8b4ecE4ZalPLwPrF0Ps9L dtkIanQOj4cMqI/FPhsc9xcPEA+ZsmyQ9JgmE+epcZS9a9v59ds4ZvyguiSl4xH4CpIk HHMOVnnXVsLhp/89JPA63qbxH9F952XeDiJAdIUR9z64ikO2mthC9/kEQZkKd6Z80sDz lCm7oGbznKrsnby65/vICmQyvIuBJv+E0qwJ84MZEy3ULEpLi2sqJDgvXso8Rg84DgRd 9Ew2fmgC+DFCvv3Wq3JqXFks4zXRUh7xKPHJUDYx3+KW4BJR3q200qIObV5xBvutXnI+ dF9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=61x93/F3fgn+1wQ9ZiL0neCWJePGUrCPPKvnadwE1Aw=; b=OQO8CAfrAEcvAPGc4WNz4uJPf2doBWPFWyOetxkHLiMxlBb2kwjnKPRoqMZZp+ywiP U9V9nlIs3e0jQtN9K/iFPbNiNOyEpvJicgEL9proyX9hof9fiqUK7wMRJIXTIFZWXXWV 8Er2UdrlaxWOBp2zMDpHLgFkakKUEtulZURWsXsljcrKr86OpRxByiCvvuGh9+KFyr4y wLsLjj2TxXnUpYLpAHI+rUKft6R9aUwaxDxDNp6vpir3uX0O04eQxEcejA+ZmY3OzjAb jtdqxfeo6gRblrE2mgW0Y3bDlZEq08P0l+A6gbQ6DyrqNJn4q61AxWWTDM4OKjOzxB9s p0Hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=I2P7CeLD; 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 t6-v6si5391044plq.275.2018.11.08.14.29.25; Thu, 08 Nov 2018 14:29:40 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=I2P7CeLD; 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 S1730830AbeKIHij (ORCPT + 99 others); Fri, 9 Nov 2018 02:38:39 -0500 Received: from mail.kernel.org ([198.145.29.99]:58070 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728090AbeKIHij (ORCPT ); Fri, 9 Nov 2018 02:38:39 -0500 Received: from localhost (unknown [208.72.13.198]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DB868214DA; Thu, 8 Nov 2018 22:01:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541714470; bh=Oc6YQyMANrvqstaoYD4DYdtsLmvsVYo2xiJ9yHVPuyg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I2P7CeLD9hKzsGSOoT91v9i6mkxKrxsWEGiKOP5fqNb/eW19iLPLPaSJSGHkYMfLr +vxT4X5k8c/n5TvnbmZqhG6rCNX2qyZj2Sn69Q4TveU71GhqYoSmXfNWZE8ElMmWfa 4nROXpwiJgbulNPc+BwfpoiE20uLEG1E0b+6kxVI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Gustavo A. R. Silva" , Mark Brown , Sasha Levin Subject: [PATCH 4.4 076/114] spi: xlp: fix error return code in xlp_spi_probe() Date: Thu, 8 Nov 2018 13:51:31 -0800 Message-Id: <20181108215107.853541900@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181108215059.051093652@linuxfoundation.org> References: <20181108215059.051093652@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 9a6b94796ae6feaf275ec6200e9b2964db208182 ] platform_get_irq() returns an error code, but the spi-xlp driver ignores it and always returns -EINVAL. This is not correct and, prevents -EPROBE_DEFER from being propagated properly. Notice that platform_get_irq() no longer returns 0 on error: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e330b9a6bb35dc7097a4f02cb1ae7b6f96df92af Print and propagate the return value of platform_get_irq on failure. This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/spi/spi-xlp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-xlp.c b/drivers/spi/spi-xlp.c index 8f04feca6ee3..0ddb0adaa8aa 100644 --- a/drivers/spi/spi-xlp.c +++ b/drivers/spi/spi-xlp.c @@ -392,8 +392,8 @@ static int xlp_spi_probe(struct platform_device *pdev) irq = platform_get_irq(pdev, 0); if (irq < 0) { - dev_err(&pdev->dev, "no IRQ resource found\n"); - return -EINVAL; + dev_err(&pdev->dev, "no IRQ resource found: %d\n", irq); + return irq; } err = devm_request_irq(&pdev->dev, irq, xlp_spi_interrupt, 0, pdev->name, xspi); -- 2.17.1