mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-15 16:24:13 +08:00
ASoC: fsi: Add check for clk_enable
[ Upstream commit405afed8a7
] As the potential failure of the clk_enable(), it should be better to check it and return error if fails. Fixes:ab6f6d8521
("ASoC: fsi: add master clock control functions") Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn> Link: https://lore.kernel.org/r/20220302062844.46869-1-jiasheng@iscas.ac.cn Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
0bdb861b7d
commit
c193128099
@ -816,14 +816,27 @@ static int fsi_clk_enable(struct device *dev,
|
||||
return ret;
|
||||
}
|
||||
|
||||
clk_enable(clock->xck);
|
||||
clk_enable(clock->ick);
|
||||
clk_enable(clock->div);
|
||||
ret = clk_enable(clock->xck);
|
||||
if (ret)
|
||||
goto err;
|
||||
ret = clk_enable(clock->ick);
|
||||
if (ret)
|
||||
goto disable_xck;
|
||||
ret = clk_enable(clock->div);
|
||||
if (ret)
|
||||
goto disable_ick;
|
||||
|
||||
clock->count++;
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
disable_ick:
|
||||
clk_disable(clock->ick);
|
||||
disable_xck:
|
||||
clk_disable(clock->xck);
|
||||
err:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int fsi_clk_disable(struct device *dev,
|
||||
|
Loading…
Reference in New Issue
Block a user