• Trent Piepho's avatar
    spi: imx: Fix failure path leak on GPIO request error correctly · 8197f489
    Trent Piepho authored
    In commit 974488e4 ("spi: imx: Fix failure path leak on GPIO request
    error"), spi_bitbang_start() was moved later in the probe sequence.  But
    this doesn't work, as spi_bitbang_start() has to be called before
    requesting GPIOs because the GPIO data in the spi master is populated when
    the master is registed, and that doesn't happen until spi_bitbang_start()
    is called.  The default only works if one uses one CS.
    
    So add a failure path call to spi_bitbang_stop() to fix the leak.
    
    CC: Shawn Guo <shawnguo@kernel.org>
    CC: Sascha Hauer <kernel@pengutronix.de>
    CC: Fabio Estevam <fabio.estevam@nxp.com>
    CC: Mark Brown <broonie@kernel.org>
    CC: Oleksij Rempel <o.rempel@pengutronix.de>
    Signed-off-by: default avatarTrent Piepho <tpiepho@impinj.com>
    Reviewed-by: default avatarOleksij Rempel <o.rempel@pengutronix.de>
    Signed-off-by: default avatarMark Brown <broonie@kernel.org>
    8197f489
spi-imx.c 43.2 KB