Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp48899imu; Thu, 8 Nov 2018 14:33:21 -0800 (PST) X-Google-Smtp-Source: AJdET5cmGEmrqk7f7tHk0Af23+gagWy5ApngC1a3+uo3ysb49Baht1fH+xESxRw5bFoRVMqDol1R X-Received: by 2002:a62:7f8c:: with SMTP id a134-v6mr6574564pfd.22.1541716401661; Thu, 08 Nov 2018 14:33:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541716401; cv=none; d=google.com; s=arc-20160816; b=b1J1mE36lSw5JUeuRQuyFsXRZ6Pdcc8yOHe8j75UKbr/PrsBpUbx9SnNFMLl5DPA0S SEeDKLsynnZxhomLJ4a3tA2sst2ssVItHTyCxkJnnAxc/ikBF4m+A9NAdel5whwcIpvD 0iZK/s0y4c2AQrnwyb6kuD9Bidkdo4DvqwsmmNLiBHtPt7/iQzDFxbX1tkWqDk4l8a38 H8jFCbFetC7CARBO5ujt96xVplhoS1wLZVhzL3q3JW12Ok89v9pJaG5vWB/t+hFz0X4/ vVkV5Ym14kcOwT/flUO36QwzmB0MoBKKxvdJglkJAKA6awudZNlk9mP58K1vZja7mY2M 6N5g== 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=ohnzDcMFBBktdkU5sTH6iOgd/H8AOiil877MkX7MwtQ=; b=yuzdGuebrKrOQ/AWDb/vc7F6LzKPMkcmY4rqWrox3bbvnxPRs5cY/VwZyxn/YNrZSW AhcH88Ax26fSk6n2+amip7zI3g1TC7R+X7CxZ/lbznKqE8PFD4Kct4rlz283Imp/xBF0 VL6bnHV0cXMZSKUVdBqhZ9d0TUr+ui63H49kCdjZy7uM2Nja6h2/F4xueRfh7dtHYHyo 3cM4rTniG0ZKY8L3ZN0K0OCM6MfLw+dxueUTL2fnvZafV8ErJxHs52z1KZhan7W+0dAp YNQIIWndvIVjU5gFbe/pXjqhcvxELfvTofs8mv7HTjm2FCd3Y3m1gD4nggRBqGU6Aw4z RV6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Q3VuO996; 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 1-v6si5891209plt.225.2018.11.08.14.33.06; Thu, 08 Nov 2018 14:33:21 -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=Q3VuO996; 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 S1730336AbeKIHhh (ORCPT + 99 others); Fri, 9 Nov 2018 02:37:37 -0500 Received: from mail.kernel.org ([198.145.29.99]:56072 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729132AbeKIHhg (ORCPT ); Fri, 9 Nov 2018 02:37:36 -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 7117620892; Thu, 8 Nov 2018 22:00:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541714407; bh=he0ugZEpe5MRfWBUUAiAwv1OUfFuHDaAESZldcJBfwc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Q3VuO996OYubn++kq675+mv5llhRyOvxPUXfjLbGD0mqpYcTHb387gfGCDq2g5h6e yR0k3kD6KCnFNTumx/1c8tUdFjvu673pZZPcbBvHH3VdeKNvfalIlRs5APtQRqPl7K HhP8LozADLz0wTkuJQQyXrXPeNSnN0AycUc68BGY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Gustavo A. R. Silva" , Sasha Levin Subject: [PATCH 4.4 064/114] tty: serial: sprd: fix error return code in sprd_probe() Date: Thu, 8 Nov 2018 13:51:19 -0800 Message-Id: <20181108215106.868174165@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 ec085c5a51b768947ca481f90b66653e36b3c566 ] platform_get_irq() returns an error code, but the sprd_serial driver ignores it and always returns -ENODEV. This is not correct and, prevents -EPROBE_DEFER from being propagated properly. Also, 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: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/tty/serial/sprd_serial.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/sprd_serial.c b/drivers/tty/serial/sprd_serial.c index 9dbae01d41ce..1e302caaa450 100644 --- a/drivers/tty/serial/sprd_serial.c +++ b/drivers/tty/serial/sprd_serial.c @@ -731,8 +731,8 @@ static int sprd_probe(struct platform_device *pdev) irq = platform_get_irq(pdev, 0); if (irq < 0) { - dev_err(&pdev->dev, "not provide irq resource\n"); - return -ENODEV; + dev_err(&pdev->dev, "not provide irq resource: %d\n", irq); + return irq; } up->irq = irq; -- 2.17.1