Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1525031pxb; Thu, 16 Sep 2021 09:13:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxL8BSbV9t5J0xmaHbycsKFj1bGKnB3IuHzw2aZoyNAX7868IomCz4JKosrG0tYYIi0iJg4 X-Received: by 2002:a1c:488:: with SMTP id 130mr5780771wme.156.1631808805921; Thu, 16 Sep 2021 09:13:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631808805; cv=none; d=google.com; s=arc-20160816; b=Nk5yh+UyBcXwYqMRvCxaDZ6jaCDT0x/9voqBdi4SXpAxGX1WrOnsYNDRneiKHzm8KR cw7OcREyJBGEt8EFKiTx+X82KYc1g5g9joFMYkXHip0m0SrafaPizsZwD3ZVfJO06EBn SDEM2B5qWB/Ym/16c+SnmOsULsaswM+ByeZ0CCMzCMGc8ec/o+XmcqAa9xAGe/lUv77l IALBt7Dvf7vR4hfS87O102L77aFKK9CWy6e6P5T3tVhwbLxDO8zrzjPkXFxRzrcEXGTK Kjv4UqV/8cQ+puEwVxuPMiZc7PKaoBspOtmYiYTA14HMutb7jKuoMmvYT3DronB93G+z D+ng== 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=3XJTGvOZqYXqe4vCVcLEBbCUOQoLewnQOlRaaesDukI=; b=EMSvfmaR9E6gm+8dumApE2eYvU7o0+BznRSyifsvafHnAnyf7LmGae+LBCqXamigQe 8vCZNNKdffW3Its1nJCnv4dbyj+OaR7nQfM/FQR+6hPowB3JoBv64ibuOs6gM6pStRn6 EipW7zfeX8Hf4KocZLQBc1mgu710a6KiB8f96yDpyskHV2UvR/dabdmeyZOgat3Yap8c x4Xdt+LKU6V+QxzbwJj/HCIJ0xtNr+XrW3FLr7AM7MbKd0jVMFFTDY4hQkWJPm3riPiz Ortn6P1Umbk2381c/ZzQDhZKGjRDdaE11tD/WY/a7xnxFYKnuv3/zYaARLKD0+rhdcCC 47DQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=W2nrMjXg; 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 dm18si3866839ejc.257.2021.09.16.09.12.59; Thu, 16 Sep 2021 09:13:25 -0700 (PDT) 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=W2nrMjXg; 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 S236674AbhIPQMM (ORCPT + 99 others); Thu, 16 Sep 2021 12:12:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:47416 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234904AbhIPQHf (ORCPT ); Thu, 16 Sep 2021 12:07:35 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id EE6FD6126A; Thu, 16 Sep 2021 16:06:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631808369; bh=kpl33kKMeZMUubWNj7vLmzSzZZZhpqs9qa4frqpNY/g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=W2nrMjXgxpgJchlYC/o7ahMxw1s5flVDtJocNbTk6S7ljAzs4gbjlMXBDxeBg8SZ6 lTXJi43ibEmK2IyBm+B5dFoSnwBQe1gc5eEdN+8tVGprHZFY15BCb0+kbtGvXJ7/IN fjAf4jN6GvAKzv9agVxpd2YtI/XlfibLUhjmxmwM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jaehyoung Choi , Sam Protsenko , Krzysztof Kozlowski , Sasha Levin Subject: [PATCH 5.10 064/306] pinctrl: samsung: Fix pinctrl bank pin count Date: Thu, 16 Sep 2021 17:56:49 +0200 Message-Id: <20210916155756.127566954@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916155753.903069397@linuxfoundation.org> References: <20210916155753.903069397@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: Jaehyoung Choi [ Upstream commit 70115558ab02fe8d28a6634350b3491a542aaa02 ] Commit 1abd18d1a51a ("pinctrl: samsung: Register pinctrl before GPIO") changes the order of GPIO and pinctrl registration: now pinctrl is registered before GPIO. That means gpio_chip->ngpio is not set when samsung_pinctrl_register() called, and one cannot rely on that value anymore. Use `pin_bank->nr_pins' instead of `pin_bank->gpio_chip.ngpio' to fix mentioned inconsistency. Fixes: 1abd18d1a51a ("pinctrl: samsung: Register pinctrl before GPIO") Signed-off-by: Jaehyoung Choi Signed-off-by: Sam Protsenko Link: https://lore.kernel.org/r/20210730192905.7173-1-semen.protsenko@linaro.org Signed-off-by: Krzysztof Kozlowski Signed-off-by: Sasha Levin --- drivers/pinctrl/samsung/pinctrl-samsung.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.c b/drivers/pinctrl/samsung/pinctrl-samsung.c index 608eb5a07248..7f809a57bee5 100644 --- a/drivers/pinctrl/samsung/pinctrl-samsung.c +++ b/drivers/pinctrl/samsung/pinctrl-samsung.c @@ -918,7 +918,7 @@ static int samsung_pinctrl_register(struct platform_device *pdev, pin_bank->grange.pin_base = drvdata->pin_base + pin_bank->pin_base; pin_bank->grange.base = pin_bank->grange.pin_base; - pin_bank->grange.npins = pin_bank->gpio_chip.ngpio; + pin_bank->grange.npins = pin_bank->nr_pins; pin_bank->grange.gc = &pin_bank->gpio_chip; pinctrl_add_gpio_range(drvdata->pctl_dev, &pin_bank->grange); } -- 2.30.2