From patchwork Mon Feb 27 20:51:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 13154178 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 783AAC64ED8 for ; Mon, 27 Feb 2023 20:52:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=pHEU9QeMo27uwZjVCdyVlHPJTaxb9S9lygYNXPjX3Ao=; b=Zzdam2kKbOiGuw wBsVJoDXoXlqwLRaExXdwVHxWzLt0xKfM2EeZ/XNgLqhwibdpCuGahta9bozZwtOqksZ650DRlloL bkkyUusAv/NIxd0LFB+tgLSMXGbqWMiCzwXx6VvsA77/xp0GC7ONes7ISpuRMlilDgMbnB2tv9m1M sFOOohPzVFypSVHL3FhjyCcTnQvKiWT2XTSmWeyyRPasUGQcaeYyjeSaS7gXmbpzwHHND3hwLeTcP W3mxSAO+BEqKWGi2XqeIz820tahVnB2q0IkNfoBtgxPjxpgW/tTNERwaXIyiR1jmdyyvl7C8bxKSN xaZ6iCNQ6TxO4WCFu8BA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pWkTJ-00BCsC-2b; Mon, 27 Feb 2023 20:51:45 +0000 Received: from mail-ed1-x529.google.com ([2a00:1450:4864:20::529]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pWkTF-00BCpq-B0 for linux-arm-kernel@lists.infradead.org; Mon, 27 Feb 2023 20:51:42 +0000 Received: by mail-ed1-x529.google.com with SMTP id ec43so31106330edb.8 for ; Mon, 27 Feb 2023 12:51:36 -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=ydReSnQP6O1AIZCquvlb2ThWZFMGWSBlREkMR9yayn8cjiWchx2NXi2NjzNmSOidiG wMj6ceo7RphMFMg8sGVkN69TkjC9KA+nKIbnITzXJvrgpCUth5vqtA4o7cafbKdoPH/+ M4kjjLmB4TNLVjpc6DHwdDkNGt+Cms8T6gZ8OPQ/qEJCZwJN+MaX4M8zXSepSqBuKOcc 6tyAbyJ2b2ohkLdrApUAmSTS+2W4VZ/v9KwJGqxL8mnhtRQB7RvXuhcYqe7CwnuR7+3x 4pMHlXq3xlrJF5CDsTQQhGFs0QECWwMRii909+6zvSoTk8jVWIPGaEqow6HNkyXwiI/M eDkA== X-Gm-Message-State: AO0yUKUuUWRKQ9HGhX9nWFO0VmNhKfHbRwNxHfJzv8FaaqEzvpAXRi9N HTJEzQiRRFYNTtWA4fv7ogOnsQ== X-Google-Smtp-Source: AK7set/09hUebX3TUSz8Zk89YxuS48cruhUseyV6cCooMrzGlOnaU2lz/zSmizCZH80dS8HxpvF7Kg== 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 To: linux-kernel@vger.kernel.org Cc: Dario Binacchi , Alexandre Torgue , Andy Shevchenko , =?utf-8?q?Bernhard_Ros?= =?utf-8?q?enkr=C3=A4nzer?= , Fabien Dessenne , Linus Walleij , Marek Vasut , Maxime Coquelin , 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230227_125141_405630_E4D71CAA X-CRM114-Status: GOOD ( 12.05 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 --- drivers/pinctrl/stm32/pinctrl-stm32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;