From patchwork Fri Jul 30 19:29:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 489339 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:1185:0:0:0:0 with SMTP id f5csp3444045jas; Fri, 30 Jul 2021 12:29:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxy8Bxl9/xt2nEtElPvKiWN0AIUJWUHYA10O79IsNOuYnRoxBFmmaQi9W7UGaECy7SdJ5YG X-Received: by 2002:a17:906:1f82:: with SMTP id t2mr4113625ejr.499.1627673350285; Fri, 30 Jul 2021 12:29:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627673350; cv=none; d=google.com; s=arc-20160816; b=Aicsw7hlqbeZrGaplEUqtJ1kcFVNjdesQWmkUnJQDworkWwVAB63p+NYqYH/HB6bOu B/uNn2l+6n0H1jsoWkSW3zZkdkGcYF0/H4SWiGOZbdpe9ckebLGCfOBf7zVl+/rUljx3 CL8NvhAwKYlclZ9tRYlGk0s/e2HZq///aTEuZGOLYvRPGT8yTf6kL0MZP0gsjk+3pCbx YG6eh/UG4Wq2EgJ+UIAcuTjGAMGQH9b+CNB0qzsvKLm9u66uSZlbpI75wS+5FHIGrANn 6jalNSLMgFao7YoISehM5EqRSJsDlZJ3t91oBYAS8msPZC27b2Mnqxcqr1g+EAlRXRad RvpA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=s+G1KU9O9GZ1sNF9QX6iHGTi6E8dVhlKip5BdOYRKkM=; b=UtVHSxt0Lo0vesxgwfX+/Zkbm/g/O19AlATqOKT0GGZLQCEPLJmrw1RrwJ1Z+5ZTOu QBe+YIc33uFzJ4nQTsW/u/ZCDK5IcSuaenv6OMa9Oz2JwlqEZWVeWzhYDUD8MCrwgroK E+lXJfBL6CeZ0Duvhs117932djBbl2mxm/7v6XgcSiJKobv+uYEqjzgv10FGUm7hZa3N eQ44f+zKWVPySUsPpC9n55/wsdWkdy9uXspVwMPAdm4dwOqMJvETmaZA9oMWcdP/ULoS D9D2NKKPFi89pWAfoAf7DMCSb6a63rp9ZgLImxb8H9hzUvCNsgaGJps4M6vTniGyrBxG ob9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="SZTMUlE/"; spf=pass (google.com: domain of linux-samsung-soc-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x12si2506973ejj.540.2021.07.30.12.29.10; Fri, 30 Jul 2021 12:29:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-samsung-soc-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=@linaro.org header.s=google header.b="SZTMUlE/"; spf=pass (google.com: domain of linux-samsung-soc-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230408AbhG3T3O (ORCPT + 4 others); Fri, 30 Jul 2021 15:29:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230483AbhG3T3N (ORCPT ); Fri, 30 Jul 2021 15:29:13 -0400 Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA182C0613C1 for ; Fri, 30 Jul 2021 12:29:07 -0700 (PDT) Received: by mail-ed1-x534.google.com with SMTP id v20so637778eda.1 for ; Fri, 30 Jul 2021 12:29:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=s+G1KU9O9GZ1sNF9QX6iHGTi6E8dVhlKip5BdOYRKkM=; b=SZTMUlE/RFHZQmOOfMjDlpQNSDIaO75ajntg+b7rHW5Lcmmw2KZWxTvdX5fxB+iN/X p8djIXAgUU41f0ALAHQNOgtlsLhQ4HE2lwkDOFI/Mfmd/8nzmptjZTdX1Cbany2yrbXz K/NNnn++SQI6E4IlxytLNOZLvBFO6qfjcaM9oalWseoSXV1UoIU+YHx+Fp8KPHWq/i/i /tk2pm3d9U8IlIVmFLhS9wAKC5aTBTN6nnavOfX9ojW/C2FapqeOhPGWDZ4t73o5VWb0 lBed1vLDF8+de5GGl/v9jiJG0JKKKe8oio6hF2E7VpbXwD15Cxlt17JfwFIN5DrKJqSP OT6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=s+G1KU9O9GZ1sNF9QX6iHGTi6E8dVhlKip5BdOYRKkM=; b=BvFGXTCWnqTP7TcfawEKiHPA6Zt6Vil1srzJSClcNUzgTTdRpO17hsksUPq1xgPdIK zRvRWdcWWI1eV2Msjw9lEIJXq7VEZvl6WWvSDM0FqOfbu/zvlg+YdsA7/s21/au+BCqq pOSZ81Tb8y1+tAdfjBVo69upUZuRQRwAZHSjj+oVigFm4Dh2UA/W9RwOvyqZIvpAWc1d jvX+HTu3Pg0U2YqA5dh2b/6tCXeF3eBw261DxLticvRNnDRGbdLjTANBh1DBqcK2WQy7 ptv93XGn3QrPozBkDUnn87qOEstbinF7aqpM3CbQpH46wJaj8g6Y77hsCOG8nekvP3qC C1lw== X-Gm-Message-State: AOAM5310fWGReP+9T9PoG1sOK7lNmBvTMcl/NK0LYvtSIXlMdtbK6QdT HPq4UZGI48bL76MbYKicQLTzPA== X-Received: by 2002:a05:6402:1b11:: with SMTP id by17mr4981656edb.110.1627673346495; Fri, 30 Jul 2021 12:29:06 -0700 (PDT) Received: from localhost ([31.134.121.151]) by smtp.gmail.com with ESMTPSA id bs13sm875938ejb.98.2021.07.30.12.29.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jul 2021 12:29:06 -0700 (PDT) From: Sam Protsenko To: Tomasz Figa , Krzysztof Kozlowski , Sylwester Nawrocki , Linus Walleij Cc: Ryu Euiyoul , Charles Keepax , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] pinctrl: samsung: Fix pinctrl bank pin count Date: Fri, 30 Jul 2021 22:29:05 +0300 Message-Id: <20210730192905.7173-1-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org From: Jaehyoung Choi 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 --- NOTE: Re-sending this fix separately, to exclude it from "Add minimal support for Exynos850 SoC" series drivers/pinctrl/samsung/pinctrl-samsung.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.30.2 diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.c b/drivers/pinctrl/samsung/pinctrl-samsung.c index 376876bd6605..2975b4369f32 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); }