]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
pinctrl: stm32: consider the GPIO offset to expose all the GPIO lines
authorFabien Dessenne <fabien.dessenne@foss.st.com>
Wed, 15 Dec 2021 09:58:08 +0000 (10:58 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Dec 2021 11:20:47 +0000 (12:20 +0100)
commita30a4d516b62ba1c453a873e6a299a1196dc892b
tree1277d3754f891400b06c1af1d30838cc6483201e
parent94cc1e8331973ee7a2b4336f7ba67f48c2877d0a
pinctrl: stm32: consider the GPIO offset to expose all the GPIO lines

commit b67210cc217f9ca1c576909454d846970c13dfd4 upstream.

Consider the GPIO controller offset (from "gpio-ranges") to compute the
maximum GPIO line number.
This fixes an issue where gpio-ranges uses a non-null offset.
  e.g.: gpio-ranges = <&pinctrl 6 86 10>
        In that case the last valid GPIO line is not 9 but 15 (6 + 10 - 1)

Cc: stable@vger.kernel.org
Fixes: 67e2996f72c7 ("pinctrl: stm32: fix the reported number of GPIO lines per bank")
Reported-by: Christoph Fritz <chf.fritz@googlemail.com>
Signed-off-by: Fabien Dessenne <fabien.dessenne@foss.st.com>
Link: https://lore.kernel.org/r/20211215095808.621716-1-fabien.dessenne@foss.st.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/pinctrl/stm32/pinctrl-stm32.c