[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210531130642.207493188@linuxfoundation.org>
Date: Mon, 31 May 2021 15:13:56 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Lukas Wunner <lukas@...ner.de>,
Qinglang Miao <miaoqinglang@...wei.com>,
Mark Brown <broonie@...nel.org>
Subject: [PATCH 4.19 060/116] spi: mt7621: Disable clock in probe error path
From: Lukas Wunner <lukas@...ner.de>
commit 24f7033405abe195224ec793dbc3d7a27dec0b98 upstream.
Commit 702b15cb9712 ("spi: mt7621: fix missing clk_disable_unprepare()
on error in mt7621_spi_probe") sought to disable the SYS clock on probe
errors, but only did so for 2 of 3 potentially failing calls: The clock
needs to be disabled on failure of devm_spi_register_controller() as
well.
Moreover, the commit purports to fix a bug in commit cbd66c626e16 ("spi:
mt7621: Move SPI driver out of staging") but in reality the bug has
existed since the driver was first introduced.
Fixes: 1ab7f2a43558 ("staging: mt7621-spi: add mt7621 support")
Signed-off-by: Lukas Wunner <lukas@...ner.de>
Cc: <stable@...r.kernel.org> # v4.17+: 702b15cb9712: spi: mt7621: fix missing clk_disable_unprepare() on error in mt7621_spi_probe
Cc: <stable@...r.kernel.org> # v4.17+
Cc: Qinglang Miao <miaoqinglang@...wei.com>
Link: https://lore.kernel.org/r/36ad42760087952fb7c10aae7d2628547c26a7ec.1607286887.git.lukas@wunner.de
Signed-off-by: Mark Brown <broonie@...nel.org>
[lukas: backport to v4.19.192]
Signed-off-by: Lukas Wunner <lukas@...ner.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
drivers/staging/mt7621-spi/spi-mt7621.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
--- a/drivers/staging/mt7621-spi/spi-mt7621.c
+++ b/drivers/staging/mt7621-spi/spi-mt7621.c
@@ -487,7 +487,11 @@ static int mt7621_spi_probe(struct platf
mt7621_spi_reset(rs, 0);
- return spi_register_master(master);
+ ret = spi_register_master(master);
+ if (ret)
+ clk_disable_unprepare(clk);
+
+ return ret;
}
static int mt7621_spi_remove(struct platform_device *pdev)
Powered by blists - more mailing lists