Commit 702b15cb authored by Qinglang Miao's avatar Qinglang Miao Committed by Mark Brown

spi: mt7621: fix missing clk_disable_unprepare() on error in mt7621_spi_probe

Fix the missing clk_disable_unprepare() before return
from mt7621_spi_probe in the error handling case.

Fixes: cbd66c62 ("spi: mt7621: Move SPI driver out of staging")
Signed-off-by: default avatarQinglang Miao <miaoqinglang@huawei.com>
Link: https://lore.kernel.org/r/20201103074912.195576-1-miaoqinglang@huawei.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 45c0cba7
......@@ -353,6 +353,7 @@ static int mt7621_spi_probe(struct platform_device *pdev)
master = spi_alloc_master(&pdev->dev, sizeof(*rs));
if (!master) {
dev_info(&pdev->dev, "master allocation failed\n");
clk_disable_unprepare(clk);
return -ENOMEM;
}
......@@ -377,6 +378,7 @@ static int mt7621_spi_probe(struct platform_device *pdev)
ret = device_reset(&pdev->dev);
if (ret) {
dev_err(&pdev->dev, "SPI reset failed!\n");
clk_disable_unprepare(clk);
return ret;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment