Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2765153imj; Mon, 11 Feb 2019 08:08:34 -0800 (PST) X-Google-Smtp-Source: AHgI3IY1spXi5ToIEdlPo7VxMlDNJWwo1pTYA+g1WKXTj/O/AWbB4imc9/tmpx64tKfB0plXRRei X-Received: by 2002:a63:e451:: with SMTP id i17mr34013834pgk.413.1549901314368; Mon, 11 Feb 2019 08:08:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549901314; cv=none; d=google.com; s=arc-20160816; b=MImo+KZv3ZByO1Eiw7SYHlOMEYY67U09PkKokqQ+bLQvhNAnccDIj2FTS8bCQMrsIR KSk3QvOvo5gAGtFKU0OiwwA2+GU7epRtMq2XqEEIY2UVgL0RrFSt6S4o3yW5VmdrH538 1ryvqo+80vkLLwkP5zZukYwnldQ/JRsZ3EqDVg37wcJgxgwB5pm2/Vcz6SumeinbyT2z Nftk5/Qdkr01aGh3VRpwPGsel6w9lTJ/3GrFfTgof8pV/l7C/uSlu6oxyI48+txv/mz+ 4lf7DAV+9uo9hcIYQgyP71Xh33LrDZ2zq/ieSoDdky5cgkUaRo1MAENYKIGmv/zCFc+9 +zgQ== 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=NiHcmSsIleOZYII3z3NIZn17VXu7rNo7tzmoj8kPxUU=; b=Ef3uARiVzw7LJIsoReQ7/eu0JUKGWfsmN+Bv1YLDG4lToG6IFnUfNO3q6XaOnVV7Tu K1OBit8Sep3KTV1wShAnRt68NMJySvoDl8zfJtXmQ7uRvelNeANs8I9vxGr+d+xrxuxU mqBzaB/zro9Yy1dvIw7q+1snKgCY+nwnC2TjJQpHlcqdtswUO73XHVjUdv+MWzn6uJLH zDEOxOfJXv7IrL502iGa65FajWFG89/jFrIG0Ax0a7L6qoy7f5NzEVI81sfc9ZdqjzGs txcJesU8Q1ADWpMDluv56/g2KZjjTue66PcYmUIBnW3SUk1o1KVdW0ceCskqzB6MCReV e2rQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=lN7CYrh9; 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 e17si9630271pgv.452.2019.02.11.08.08.18; Mon, 11 Feb 2019 08:08:34 -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=lN7CYrh9; 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 S1729605AbfBKO0s (ORCPT + 99 others); Mon, 11 Feb 2019 09:26:48 -0500 Received: from mail.kernel.org ([198.145.29.99]:60614 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728219AbfBKO0n (ORCPT ); Mon, 11 Feb 2019 09:26:43 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (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 A37C7218A3; Mon, 11 Feb 2019 14:26:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549895202; bh=ORHMkE56yCpPS36/XCErJUN4nbC/6zb61EDCVquZ3Z8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lN7CYrh9Rv1VSr/Yq3y7CRWeEEaiWa+sfcpgEi+d9LNxBGn1fOVUiDtQX8MS1/4Hs +2RjkRhan0G4huD7WXXdGqHUdfgzJoM0BgQgn1y1hHgKyWo0Ix76fiRtZHFqZ7nj+/ GGEIBS6shBtfI7MhTSzzg+P9sjAqeJf+hwl/4FME= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nicholas Mc Guire , Sean Wang , Linus Walleij , Sasha Levin Subject: [PATCH 4.20 128/352] gpio: mt7621: pass mediatek_gpio_bank_probe() failure up the stack Date: Mon, 11 Feb 2019 15:15:55 +0100 Message-Id: <20190211141854.538563288@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141846.543045703@linuxfoundation.org> References: <20190211141846.543045703@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore 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.20-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit a109c2dbb571b10bb9969285b646f57309c98251 ] The error cases of mediatek_gpio_bank_probe() would go unnoticed (except for the dev_err() messages). The probe function should return an error if one of the banks failed to initialize properly indicated by not returning non-0. Fixes: 4ba9c3afda41 ("gpio: mt7621: Add a driver for MT7621") Signed-off-by: Nicholas Mc Guire Acked-by: Sean Wang Signed-off-by: Linus Walleij Signed-off-by: Sasha Levin --- drivers/gpio/gpio-mt7621.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/gpio/gpio-mt7621.c b/drivers/gpio/gpio-mt7621.c index 1ec95bc18f5b..00e954f22bc9 100644 --- a/drivers/gpio/gpio-mt7621.c +++ b/drivers/gpio/gpio-mt7621.c @@ -297,6 +297,7 @@ mediatek_gpio_probe(struct platform_device *pdev) struct device_node *np = dev->of_node; struct mtk *mtk; int i; + int ret; mtk = devm_kzalloc(dev, sizeof(*mtk), GFP_KERNEL); if (!mtk) @@ -311,8 +312,11 @@ mediatek_gpio_probe(struct platform_device *pdev) platform_set_drvdata(pdev, mtk); mediatek_gpio_irq_chip.name = dev_name(dev); - for (i = 0; i < MTK_BANK_CNT; i++) - mediatek_gpio_bank_probe(dev, np, i); + for (i = 0; i < MTK_BANK_CNT; i++) { + ret = mediatek_gpio_bank_probe(dev, np, i); + if (ret) + return ret; + } return 0; } -- 2.19.1