• Marco Felsch's avatar
    pinctrl: mcp23s08: fix irq and irqchip setup order · f259f896
    Marco Felsch authored
    Since 'commit 02e389e6 ("pinctrl: mcp23s08: fix irq setup order")' the
    irq request isn't the last devm_* allocation. Without a deeper look at
    the irq and testing this isn't a good solution. Since this driver relies
    on the devm mechanism, requesting a interrupt should be the last thing
    to avoid memory corruptions during unbinding.
    
    'Commit 02e389e6 ("pinctrl: mcp23s08: fix irq setup order")' fixed the
    order for the interrupt-controller use case only. The
    mcp23s08_irq_setup() must be split into two to fix it for the
    interrupt-controller use case and to register the irq at last. So the
    irq will be freed first during unbind.
    
    Cc: stable@vger.kernel.org
    Cc: Jan Kundrát <jan.kundrat@cesnet.cz>
    Cc: Dmitry Mastykin <mastichi@gmail.com>
    Cc: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
    Fixes: 82039d24 ("pinctrl: mcp23s08: add pinconf support")
    Fixes: 02e389e6 ("pinctrl: mcp23s08: fix irq setup order")
    Signed-off-by: default avatarMarco Felsch <m.felsch@pengutronix.de>
    Tested-by: default avatarPhil Reid <preid@electromag.com.au>
    Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
    f259f896
pinctrl-mcp23s08.c 29.6 KB