• Linus Walleij's avatar
    gpio: nomadik: Back out some managed resources · 5545d501
    Linus Walleij authored
    Several commits introduce managed resources (devm_*) into the
    nmk_gpio_populate_chip() function.
    
    This isn't always working because when called from the Nomadik pin
    control driver we just want to populate some states for the device as
    the same states are used by the pin control driver.
    
    Some managed resources such as devm_kzalloc() etc will work, as the
    passed in platform device will be used for lifecycle management,
    but in some cases where we used the looked-up platform device
    for the GPIO block, this will cause problems for the combined
    pin control and GPIO driver, because it adds managed resources
    to the GPIO device before it is probed, which is something that
    the device core will not accept, and all of the GPIO blocks will
    refuse to probe:
    
    platform 8012e000.gpio: Resources present before probing
    platform 8012e080.gpio: Resources present before probing
    (...)
    
    Fix this by not tying any managed resources to the looked-up
    gpio_pdev/gpio_dev device, let's just live with the fact that
    these need imperative resource management for now.
    
    Drop in some notes and use a local *dev variable to clarify the
    code.
    
    Cc: Théo Lebrun <theo.lebrun@bootlin.com>
    Fixes: 12410e95 ("gpio: nomadik: use devm_platform_ioremap_resource() helper")
    Link: https://lore.kernel.org/r/20240305-fix-nomadik-gpio-v2-1-e5d1fbdc3f5c@linaro.org
    [Fixed some last minut print formatting]
    Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
    5545d501
gpio-nomadik.c 18.6 KB