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: cbd66c626e
("spi: mt7621: Move SPI driver out of staging")
Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com>
Link: https://lore.kernel.org/r/20201103074912.195576-1-miaoqinglang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
45c0cba753
commit
702b15cb97
1 changed files with 2 additions and 0 deletions
|
@ -353,6 +353,7 @@ static int mt7621_spi_probe(struct platform_device *pdev)
|
||||||
master = spi_alloc_master(&pdev->dev, sizeof(*rs));
|
master = spi_alloc_master(&pdev->dev, sizeof(*rs));
|
||||||
if (!master) {
|
if (!master) {
|
||||||
dev_info(&pdev->dev, "master allocation failed\n");
|
dev_info(&pdev->dev, "master allocation failed\n");
|
||||||
|
clk_disable_unprepare(clk);
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -377,6 +378,7 @@ static int mt7621_spi_probe(struct platform_device *pdev)
|
||||||
ret = device_reset(&pdev->dev);
|
ret = device_reset(&pdev->dev);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
dev_err(&pdev->dev, "SPI reset failed!\n");
|
dev_err(&pdev->dev, "SPI reset failed!\n");
|
||||||
|
clk_disable_unprepare(clk);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue