Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9440237pxu; Mon, 28 Dec 2020 16:37:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJyZuYdFNHt4pYA8O7z4GnsyAqaDXHS1+QPcAm77XF+y6uhmllaXbt+rt4EFBKUTyCXfk4uI X-Received: by 2002:a17:906:fa12:: with SMTP id lo18mr44973671ejb.354.1609202255494; Mon, 28 Dec 2020 16:37:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609202255; cv=none; d=google.com; s=arc-20160816; b=rCBNvp+I40tPsMVmcvu3F32eGMzMVZar+yidE/xEqMafkAe4jGLCXuLJuYyF4qiGzo OzFMAUQyCQFDwm/FLGeq3upbKocLGP4XwL+8E3mlqPUQIb3I05d9JO5xrJ1S9vCfYKly 5Hkde2AgJZNKphBNzzbnYEOMtBZ5havV3HW6IXKwcQHvLlKP8arOw8E1bbouyOfmY4is sNwRHQMzZ7YvApqdQEwixv+4KlEy/f5LEpcEMVbUF9qTdV0KJ41A2MJPG61SJ4y9jKVQ XQWhYzsRAqnYuZw8Z9PccceJDgkNVsTyeR/2PRwyS8RkfcGa6gg+KoPiu6p+EuD4hUyV 2Qtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=5fX3iBoNeEIcp8rkm1CEGgZqQCKhz+mMUoGtB6+ryrE=; b=PB9XoNoWBljBhXJ7rIfE1j2iKFMUzXn6qFMqhSmt354kYOPu4BMxVvosAs7d1fje2J rhboLv9UvZXyFNF9BYbIpbbDCWUCIUNt5ubmNUXna3tcf+kKLce3NIAOy+mSm7LKBESS quOBA8hIHwmhbgqiCfJem4NcMhPWho1zlLTB7qWizCJ1f3wAOVh87SmtEqdPP4+qbm6v DeOUw4fvSGQTid9XuNqCJSOrTtnsClyo2tesnNsd2aKly8Ai6m2288fBu1wTtBs6nTks GnbpSNTtojfudXHZfOK+my06EGSxLg7iP9VN/0crEJJIqgFTUO0RHXb2+rLNOx9d2KVK BuUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lv+A+Kb5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e21si20508792edv.260.2020.12.28.16.37.13; Mon, 28 Dec 2020 16:37:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lv+A+Kb5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2633137AbgL1PwY (ORCPT + 99 others); Mon, 28 Dec 2020 10:52:24 -0500 Received: from mail.kernel.org ([198.145.29.99]:38492 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391304AbgL1NiP (ORCPT ); Mon, 28 Dec 2020 08:38:15 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5F87620719; Mon, 28 Dec 2020 13:37:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609162655; bh=GcYb3UGm+AeIRSJLrACdD7S2tv92iHyqNyHnlw1TMr4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lv+A+Kb51lI/4/1cdx6pot+cjNTaa8CqjM87d32K6UEsSiyDLuhEmV0SnC40v8jUK AzZD44hsCOc+PERINW4TiGwHc6auPFudwwXIf+gaAUjgCQimnWViqz8AI3mbVYkR81 B4pLafSVTdo+TVwlsa1T+vAXT/8Vrz936MyFfG7A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chunyan Zhang , Linus Walleij , Sasha Levin Subject: [PATCH 5.4 027/453] gpio: eic-sprd: break loop when getting NULL device resource Date: Mon, 28 Dec 2020 13:44:23 +0100 Message-Id: <20201228124938.565468823@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228124937.240114599@linuxfoundation.org> References: <20201228124937.240114599@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chunyan Zhang [ Upstream commit 263ade7166a2e589c5b605272690c155c0637dcb ] EIC controller have unfixed numbers of banks on different Spreadtrum SoCs, and each bank has its own base address, the loop of getting there base address in driver should break if the resource gotten via platform_get_resource() is NULL already. The later ones would be all NULL even if the loop continues. Fixes: 25518e024e3a ("gpio: Add Spreadtrum EIC driver support") Signed-off-by: Chunyan Zhang Link: https://lore.kernel.org/r/20201209055106.840100-1-zhang.lyra@gmail.com Signed-off-by: Linus Walleij Signed-off-by: Sasha Levin --- drivers/gpio/gpio-eic-sprd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpio/gpio-eic-sprd.c b/drivers/gpio/gpio-eic-sprd.c index 8c97577740100..a69b3faf51ef0 100644 --- a/drivers/gpio/gpio-eic-sprd.c +++ b/drivers/gpio/gpio-eic-sprd.c @@ -598,7 +598,7 @@ static int sprd_eic_probe(struct platform_device *pdev) */ res = platform_get_resource(pdev, IORESOURCE_MEM, i); if (!res) - continue; + break; sprd_eic->base[i] = devm_ioremap_resource(&pdev->dev, res); if (IS_ERR(sprd_eic->base[i])) -- 2.27.0