On 3/5/21 11:44 AM, Andy Shevchenko wrote:
On Fri, Mar 05, 2021 at 12:09:56AM +0100, Marek Vasut wrote:
This reverts 7cba1a4d5e162 ("gpiolib: generalize devprop_gpiochip_set_names()
for device properties") because this breaks OF "gpio-line-names" behavior on
STM32MP1 platform.
On STM32MP1, the GPIO banks are subnodes of pin-controller@50002000, see
arch/arm/boot/dts/stm32mp151.dtsi. The driver for pin-controller@50002000
is in drivers/pinctrl/stm32/pinctrl-stm32.c and iterates over all of its DT
subnodes when registering each GPIO bank gpiochip. Each gpiochip has:
- gpio_chip.parent = dev where dev is the device node of the pin controller
- gpio_chip.of_node = np which is the OF node of the GPIO bank
Therefore, dev_fwnode(chip->parent) != of_fwnode_handle(chip.of_node) , i.e.
pin-controller@50002000 != pin-controller@50002000/gpio@5000*000.
The original code behaved correctly, as it extracted the "gpio-line-names"
from of_fwnode_handle(chip.of_node) = pin-controller@50002000/gpio@5000*000.
This patch reinstates the original correct behavior.
Signed-off-by: Marek Vasut <marex@xxxxxxx>
Reported-by: Roman Guskov <rguskov@xxxxxxxxxxxxxxxxxx>
Thanks for the report and a fix!
However I think the revert is not an option. We may do much better.
The revert is pretty much also the minimal change to reinstate the
original behavior. What better option do you have in mind, please do
elaborate in detail. Thank you.