OSDN Git Service

spi: synquacer: Disable clock in probe error path
authorLukas Wunner <lukas@wunner.de>
Sun, 8 Nov 2020 22:41:00 +0000 (23:41 +0100)
committerMark Brown <broonie@kernel.org>
Thu, 12 Nov 2020 15:16:33 +0000 (15:16 +0000)
commit8853b2503014aca5c793d2c7f0aabc990b32bdad
tree74c0d364c1d7d3b8030182d098d4967b88df0a97
parent10a58c3a308af20d4fecc99cd81ef37599890c25
spi: synquacer: Disable clock in probe error path

If the calls to platform_get_irq() or devm_request_irq() fail on probe
of the SynQuacer SPI driver, the clock "sspi->clk" is erroneously not
unprepared and disabled.

If the clock rate "master->max_speed_hz" cannot be determined, the same
happens and in addition the spi_master struct is not freed.

Fix it.

Fixes: b0823ee35cf9 ("spi: Add spi driver for Socionext SynQuacer platform")
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Cc: <stable@vger.kernel.org> # v5.3+
Cc: Masahisa Kojima <masahisa.kojima@linaro.org>
Link: https://lore.kernel.org/r/232281df1ab91d8f0f553a62d5f97fc264ace4da.1604874488.git.lukas@wunner.de
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-synquacer.c