Message ID | 20211227151320.316813625@linuxfoundation.org |
---|---|
State | Superseded |
Headers | show
Return-Path: <stable-owner@kernel.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A5CADC433EF for <stable@archiver.kernel.org>; Mon, 27 Dec 2021 15:33:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237470AbhL0Pdw (ORCPT <rfc822;stable@archiver.kernel.org>); Mon, 27 Dec 2021 10:33:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35758 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237796AbhL0PdZ (ORCPT <rfc822;stable@vger.kernel.org>); Mon, 27 Dec 2021 10:33:25 -0500 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20B50C06179B; Mon, 27 Dec 2021 07:33:25 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 72A9FCE10CC; Mon, 27 Dec 2021 15:33:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 40F00C36AEA; Mon, 27 Dec 2021 15:33:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1640619201; bh=kuW4Gh6HoekXWP2yZW99KB05AYXbMmzd89GbpqaqzFE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cjDHUVH+e3S3gta79O3fZfKDkbfvBryHTWyLQIKRxk3tl1Hz/3DZwiG873e/wvwCB 61Z3N86QoiqWM+8Yp6c6Yj/9voTUXqm6F4DxbOgQBxE7MEp7bUUzpve+RludgdnFXP X+MAx6ZwBvdvylbWLy2UaLbatP6uI2KvfW+teyQM= From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, stable@vger.kernel.org, Christoph Fritz <chf.fritz@googlemail.com>, Fabien Dessenne <fabien.dessenne@foss.st.com>, Linus Walleij <linus.walleij@linaro.org> Subject: [PATCH 4.19 28/38] pinctrl: stm32: consider the GPIO offset to expose all the GPIO lines Date: Mon, 27 Dec 2021 16:31:05 +0100 Message-Id: <20211227151320.316813625@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20211227151319.379265346@linuxfoundation.org> References: <20211227151319.379265346@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: <stable.vger.kernel.org> X-Mailing-List: stable@vger.kernel.org |
Series |
None
|
expand
|
--- a/drivers/pinctrl/stm32/pinctrl-stm32.c +++ b/drivers/pinctrl/stm32/pinctrl-stm32.c @@ -1011,10 +1011,10 @@ static int stm32_gpiolib_register_bank(s bank_nr = args.args[1] / STM32_GPIO_PINS_PER_BANK; bank->gpio_chip.base = args.args[1]; - npins = args.args[2]; - while (!of_parse_phandle_with_fixed_args(np, "gpio-ranges", 3, - ++i, &args)) - npins += args.args[2]; + /* get the last defined gpio line (offset + nb of pins) */ + npins = args.args[0] + args.args[2]; + while (!of_parse_phandle_with_fixed_args(np, "gpio-ranges", 3, ++i, &args)) + npins = max(npins, (int)(args.args[0] + args.args[2])); } else { bank_nr = pctl->nbanks; bank->gpio_chip.base = bank_nr * STM32_GPIO_PINS_PER_BANK;