Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3628654imu; Mon, 28 Jan 2019 08:06:08 -0800 (PST) X-Google-Smtp-Source: ALg8bN60kDQe07CLw37O0UKMOP29fIJrOXf7zL+lptVUejgeVdC1fOxwsk6t2/iN7cyYoAatrxSn X-Received: by 2002:a62:fb07:: with SMTP id x7mr22308705pfm.71.1548691568451; Mon, 28 Jan 2019 08:06:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548691568; cv=none; d=google.com; s=arc-20160816; b=EO2CDzyyivHLbk+pqrorS0ARum3dPtcHXzupzWf1zWt8qTL0+PSrrRumfg6+wv5yKb W2IMf+b5TKFf0d2qliDXPl6dqgFtEgRPXNosmvVsvOgbudP35aSIlz6jYdGFMZn0dlzI Y3Ftp80L/rR8M4PWDB5eHBG/1r+rm5Q90VEWDy7r2/LNx7YQeJ1rUzzXr7wfJQi4vazE 6wje2lnRjF8PTI72Jh/+xV7QhuwQF+O60/fa1282aba/KFb9NDK0Z4bYBkbwWFUQQQVA H/KWK02y7PfDgkASDSaBQkh06gFtgvl4WxeqvDDvJljsscR1ySXfJWzOzJGpdiryO+92 fwyA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=WU4fYJ07JATXu68c9J1OMqRzATrs67EAPdiQA0NN8jY=; b=vFceP81NzlBH8TdeITt9vCI5+xigEccSNTbc4LuduwEJC7xTQ5/fvSo+pl535iRO4f DxiqYOPD7r3kkY0/KlEAzvcDyAOUcZkLca5oUUnb8VHBZaJ71Pk7h/kL84Zz4XHVr9DD TvuNz1K4+kqvilnDXyAdWSR6wDd9isQlwxUYT4GWT1NWchS8cfuCmU9Wk6lMm6jUBNCh uzskYgRFiGO04u4t84J8ME9QUuwfUl6onTbZaocscCDTLxoAgq/5bW2clYbpzyFVf0lS MG2+ROgGK6AgPSi2KP9YN1rbcZObeos7g+o8UDxomg0QQqQUqdu9q6/NU/GC5gd4ks+V Y3/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ahwTTwtk; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p22si32482643pgl.340.2019.01.28.08.05.53; Mon, 28 Jan 2019 08:06:08 -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=ahwTTwtk; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731732AbfA1QFB (ORCPT + 99 others); Mon, 28 Jan 2019 11:05:01 -0500 Received: from mail.kernel.org ([198.145.29.99]:51044 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731713AbfA1QE6 (ORCPT ); Mon, 28 Jan 2019 11:04:58 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 85C4F2147A; Mon, 28 Jan 2019 16:04:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548691497; bh=OhWL43AS179SrHPdoU2OtfJg66jHdWNiT9plSOTdTR4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ahwTTwtkPI13pW/SGWmcA9CHzkB0yaXfSu10cFYI60UEe0N7m6kjgc7O3DrDAEf3N DO6j/V5Eh30pp7NdYVaTREwcNsgbanCDsqWairsbN1g7qssgv4cPsxvXr4z1LXOxd7 HWZba80KxPKaDflM9K/TWt1qmO6ZgOOMGCo+7ktY= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Nicholas Mc Guire , Linus Walleij , Sasha Levin , linux-gpio@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 116/258] gpio: mt7621: pass mediatek_gpio_bank_probe() failure up the stack Date: Mon, 28 Jan 2019 10:57:02 -0500 Message-Id: <20190128155924.51521-116-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190128155924.51521-1-sashal@kernel.org> References: <20190128155924.51521-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nicholas Mc Guire [ 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