Message ID | 20230227205131.2104082-1-dario.binacchi@amarulasolutions.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp2643031wrd; Mon, 27 Feb 2023 13:00:55 -0800 (PST) X-Google-Smtp-Source: AK7set8BCR+K0IZ09Ymt42eV+Q6UVYP2niAb4VWxIjMvVvXofn5fs08YWDtx0MwyO0WSq5UYEYSe X-Received: by 2002:a17:906:7690:b0:8b1:7ae8:ba79 with SMTP id o16-20020a170906769000b008b17ae8ba79mr47601ejm.30.1677531655557; Mon, 27 Feb 2023 13:00:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677531655; cv=none; d=google.com; s=arc-20160816; b=NKs5dLLBQVa6/+Uw8JxlEHcnBMAoR9B5tNWlS2w4Xrj6EMDvC2wYgfN4Oj/ky8B74u Ojudana+NhX07aERtqHF0kZqqglOqp6y+bn7gnjF7uG4J3WB4/o0Fvivd65Mfzwpoycd W1AXoNuOhtN7PPRsW/uoboRmsdlwxZx//zdIS6rOaO9d4mpyN5DAkguTjYIN/+pGTAIR gAdS/Bves0hclz/yaq+QEhz04qZ1jg65k1x1a+KVgxLdXSSQigFK3xWmVmiIkczpoOzb sTCi0YMkgsjvIGp8CuAfJtpzeWfTbSSDeHgRxtyvur1yXKE9I+QxZS4LVmv049r28Z+c 4U6w== 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=e124E0pr34PAN91uKXPAbGtavFgIogfWrydKthVEf0E=; b=du3j1wO5/NDpjg/MO8zoxIHN8yDRFWLnQGcjMHD34ej6GafQcI47ogUsPcuMa+C8tH BlXxsKTM7ECTUMgX8A4fAH92vyS7ITwpnClz+fSvx+SOaZDHIlG/WA3FFIX/rxZMiHsR NAQAcE2h8MRKumPda3f+6kJP0k8ZzMyMoy3nsXQCekHDqN8QflFZp8yUp0xunt9ByxXu WJlYajNFI+1UwhdjgseoYQq7SsFT8r8ArKoC4Ls3CEqxn5P5q9SjrNL09JlB9rftzcyD y5jwSA3wpW/ZSUnShAX1E2ra3jszCB+Y2+D1cscvvQQZ/vEmJ417vQN0qqrxwSyjOgw7 Kyvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Msljfd0D; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z2-20020a170906814200b008dbed6ec6c2si728464ejw.578.2023.02.27.13.00.31; Mon, 27 Feb 2023 13:00:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=Msljfd0D; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229630AbjB0Uvk (ORCPT <rfc822;wenzhi022@gmail.com> + 99 others); Mon, 27 Feb 2023 15:51:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229471AbjB0Uvi (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 27 Feb 2023 15:51:38 -0500 Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 754E71EFEF for <linux-kernel@vger.kernel.org>; Mon, 27 Feb 2023 12:51:37 -0800 (PST) Received: by mail-ed1-x52d.google.com with SMTP id cy6so31175683edb.5 for <linux-kernel@vger.kernel.org>; Mon, 27 Feb 2023 12:51:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=e124E0pr34PAN91uKXPAbGtavFgIogfWrydKthVEf0E=; b=Msljfd0DAOSV1Ng8uIK/mnFUzcITqVx7VNkBOQVwfqu7nD/mLOXNK+QL9hurrXRwFn W22/+c8iLbrDPOIExuNn6xorlSdGmNDZocrV4NhDMD8Dm3bnuuyL2lwLSBJiZQs3BAqF EYXQKn9EBAsLGT8Z+8bQyvV+taV8ZMcm7P5ms= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=e124E0pr34PAN91uKXPAbGtavFgIogfWrydKthVEf0E=; b=jeXQz6cEhF0CCy5XhhsXB2+IA9/p2oFeJqagxTnqNA8lShLjL8uwV+pjtkKFChViMe rRtzX6diXaHPR1gBPAISkBv+CszagKdmPtXVJc/lJLM/oclTMvb6fbjXf1AbrQwb1Hz3 n3I6nGLY5yEoNMsxxSwbNw3W5r886dyKdQqy7b6SNl5Wy9KvASPmWos7Ej/F/JZANKTR 5jqZXaiTBdT3yEOiJU98aF3s6H9wELi3ZA+LCO1IAgPS1osclxwksSz/pYoO3RklP7j8 eFiNCXtYnKFQfTKxlV9CRAzN8ftOjct5YMzgy8lR5HsPmZBndRY6h/4tpvYPRRBmY082 8JPQ== X-Gm-Message-State: AO0yUKW+t++iQWNILZstIDb3yQfp6U82k8410GyY5sn7GYvB4CZ/ja1Y ku26448g2YScESBNKTxbQDv5fUV17ReCH7n4R2w= X-Received: by 2002:aa7:d98d:0:b0:4ad:5950:3f47 with SMTP id u13-20020aa7d98d000000b004ad59503f47mr963127eds.9.1677531095698; Mon, 27 Feb 2023 12:51:35 -0800 (PST) Received: from dario-ThinkPad-T14s-Gen-2i.homenet.telecomitalia.it (host-82-56-22-12.retail.telecomitalia.it. [82.56.22.12]) by smtp.gmail.com with ESMTPSA id i26-20020a50871a000000b004af70a660a9sm3578032edb.75.2023.02.27.12.51.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Feb 2023 12:51:35 -0800 (PST) From: Dario Binacchi <dario.binacchi@amarulasolutions.com> To: linux-kernel@vger.kernel.org Cc: Dario Binacchi <dario.binacchi@amarulasolutions.com>, Alexandre Torgue <alexandre.torgue@foss.st.com>, Andy Shevchenko <andriy.shevchenko@linux.intel.com>, =?utf-8?q?Bernhard_Ros?= =?utf-8?q?enkr=C3=A4nzer?= <bero@baylibre.com>, Fabien Dessenne <fabien.dessenne@foss.st.com>, Linus Walleij <linus.walleij@linaro.org>, Marek Vasut <marex@denx.de>, Maxime Coquelin <mcoquelin.stm32@gmail.com>, linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com Subject: [PATCH] pinctrl: stm32: use dynamic allocation of GPIO base Date: Mon, 27 Feb 2023 21:51:31 +0100 Message-Id: <20230227205131.2104082-1-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759019433335486195?= X-GMAIL-MSGID: =?utf-8?q?1759019433335486195?= |
Series |
pinctrl: stm32: use dynamic allocation of GPIO base
|
|
Commit Message
Dario Binacchi
Feb. 27, 2023, 8:51 p.m. UTC
Since commit 502df79b860563d7 ("gpiolib: Warn on drivers still using static
gpiobase allocation"), one or more warnings are printed during boot on
systems where static allocation of GPIO base is used:
[ 0.197707] gpio gpiochip0: Static allocation of GPIO base is deprecated, use dynamic allocation.
[ 0.199942] stm32f429-pinctrl soc:pinctrl@40020000: GPIOA bank added
[ 0.200711] gpio gpiochip1: Static allocation of GPIO base is deprecated, use dynamic allocation.
[ 0.202855] stm32f429-pinctrl soc:pinctrl@40020000: GPIOB bank added
[ 0.203591] gpio gpiochip2: Static allocation of GPIO base is deprecated, use dynamic allocation.
[ 0.205704] stm32f429-pinctrl soc:pinctrl@40020000: GPIOC bank added
[ 0.206338] gpio gpiochip3: Static allocation of GPIO base is deprecated, use dynamic allocation.
[ 0.208448] stm32f429-pinctrl soc:pinctrl@40020000: GPIOD bank added
[ 0.209182] gpio gpiochip4: Static allocation of GPIO base is deprecated, use dynamic allocation.
[ 0.211282] stm32f429-pinctrl soc:pinctrl@40020000: GPIOE bank added
[ 0.212094] gpio gpiochip5: Static allocation of GPIO base is deprecated, use dynamic allocation.
[ 0.214270] stm32f429-pinctrl soc:pinctrl@40020000: GPIOF bank added
[ 0.215005] gpio gpiochip6: Static allocation of GPIO base is deprecated, use dynamic allocation.
[ 0.217110] stm32f429-pinctrl soc:pinctrl@40020000: GPIOG bank added
[ 0.217845] gpio gpiochip7: Static allocation of GPIO base is deprecated, use dynamic allocation.
[ 0.219959] stm32f429-pinctrl soc:pinctrl@40020000: GPIOH bank added
[ 0.220602] gpio gpiochip8: Static allocation of GPIO base is deprecated, use dynamic allocation.
[ 0.222714] stm32f429-pinctrl soc:pinctrl@40020000: GPIOI bank added
[ 0.223483] gpio gpiochip9: Static allocation of GPIO base is deprecated, use dynamic allocation.
[ 0.225594] stm32f429-pinctrl soc:pinctrl@40020000: GPIOJ bank added
[ 0.226336] gpio gpiochip10: Static allocation of GPIO base is deprecated, use dynamic allocation.
[ 0.228490] stm32f429-pinctrl soc:pinctrl@40020000: GPIOK bank added
So let's follow the suggestion and use dynamic allocation.
Tested on STM32F429I-DISC1 board.
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---
drivers/pinctrl/stm32/pinctrl-stm32.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Mon, Feb 27, 2023 at 9:51 PM Dario Binacchi <dario.binacchi@amarulasolutions.com> wrote: > Since commit 502df79b860563d7 ("gpiolib: Warn on drivers still using static > gpiobase allocation"), one or more warnings are printed during boot on > systems where static allocation of GPIO base is used: Patch applied for fixes. Yours, Linus Walleij
diff --git a/drivers/pinctrl/stm32/pinctrl-stm32.c b/drivers/pinctrl/stm32/pinctrl-stm32.c index cb33a23ab0c1..04ace4c7bd58 100644 --- a/drivers/pinctrl/stm32/pinctrl-stm32.c +++ b/drivers/pinctrl/stm32/pinctrl-stm32.c @@ -1330,7 +1330,7 @@ static int stm32_gpiolib_register_bank(struct stm32_pinctrl *pctl, struct fwnode if (fwnode_property_read_u32(fwnode, "st,bank-ioport", &bank_ioport_nr)) bank_ioport_nr = bank_nr; - bank->gpio_chip.base = bank_nr * STM32_GPIO_PINS_PER_BANK; + bank->gpio_chip.base = -1; bank->gpio_chip.ngpio = npins; bank->gpio_chip.fwnode = fwnode;