Received: by 2002:a05:6520:4d:b0:139:a872:a4c9 with SMTP id i13csp2565284lkm; Mon, 20 Sep 2021 18:51:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJtVCiNP+rAG/3LIHhQqKir73ALHcW5Bm/gl/CpKXeEj/k9BQfMG8vDxRMrUEVMk0qdoXY X-Received: by 2002:a5e:c110:: with SMTP id v16mr7491788iol.43.1632189088362; Mon, 20 Sep 2021 18:51:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632189088; cv=none; d=google.com; s=arc-20160816; b=cwknq3vTuxckH9+8sOExpoJt7uqbAACjAMIDbsYqbxUcu5PE+h5nVExuVtNzoZpWJi GSZ9SeT7FiG+o+5xp01DbiC/YIMSFXvYMPi51npL90lMMyN/QSitJP998Ob7rg0HvdDD UzKC4bEWXaQD9EH5aWScSTewdcjE8RYfJAMuEhBkwocJiTlpD6fcYUAwuurWjQokkETu AmmoBFpRfG6YtuGW9gqoYnWNevUcYry5ORzOjndHHNygtn81axKmv8fnjf8fa8qAHtZf rnvEhiu84KUx5ra7m+PGLdPbR0HykNnZOIvdQElWvkT8m3uLUmP711RImVTZ+yebiuTu 6TZQ== 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=3JWgcrGR1TLk7lx6CVP1OAo/JqEZ+zQ1NeLUIOKZV8g=; b=EncfUCHdZArT7X/XbwgawNl//3tqhvB0OfNtw3PWAz7Le7HUeAQPc8Dx02q8lC/yxq qRwZXZvlH1lY7xcSPGBd3/fylRdCbv9MxxIS+lHaMaqPdElPSvX4vlhyszpW7LqBsHFe AWDlPhw7wY2zhPv0Gjn+z+UtUKJD0rTLq8hCDsSBTIyL1gz8WkWuEK6rM8YvgFdkrwak H7htkPqKCwSjKRlundSpd1xz7b1nSYOsOcT7sMdPD7ddgCktg7s8yTJdsrLspyEPjsGL Y1ZLb0WQgtNzvUy0hEB+LfRWOUhcx7f6iJqNHx6gTitlunqs5lgGHrWHR41oUBnkM8e9 zkEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=B3MLcK6t; 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 j15si13853953jac.8.2021.09.20.18.50.49; Mon, 20 Sep 2021 18:51:28 -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=B3MLcK6t; 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 S1359752AbhITSKP (ORCPT + 99 others); Mon, 20 Sep 2021 14:10:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:58284 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357041AbhITSCo (ORCPT ); Mon, 20 Sep 2021 14:02:44 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E030D63244; Mon, 20 Sep 2021 17:16:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632158193; bh=pPr+lQJQa08wUC9dVB/PsHh1UA4Qgln97N5XbGeZTMg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B3MLcK6tn22EZyFIv6XQt102ML8g4MZD1XvRs6QMOpIDhEER+fK/kHfQzYdd10OY5 Sbr2WohCs9JsKitkAlsR81ryS7wc8Ofuc1I5MKdEuD/mTOu8agDz6wQWvIPf/4btxb EtG7fk0JERTd7HCMdyDcJ1G0NzUB0cdo9FLzC/3Q= 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.4 042/260] pinctrl: samsung: Fix pinctrl bank pin count Date: Mon, 20 Sep 2021 18:41:00 +0200 Message-Id: <20210920163932.546676444@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163931.123590023@linuxfoundation.org> References: <20210920163931.123590023@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 f26574ef234a..601fffeba39f 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