mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 18:13:41 +02:00
ASoC: sun8i-codec: Remove unnecessary NULL check before clk_prepare_enable/clk_disable_unprepare
clk_prepare_enable() and clk_disable_unprepare() already checked NULL clock parameter.Remove unneeded NULL check for clk here. Signed-off-by: Chen Ni <nichen@iscas.ac.cn> Link: https://patch.msgid.link/20250325092640.996802-1-nichen@iscas.ac.cn Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
d0e1a832ce
commit
ad20e1f877
|
|
@ -248,12 +248,10 @@ static int sun8i_codec_runtime_resume(struct device *dev)
|
|||
struct sun8i_codec *scodec = dev_get_drvdata(dev);
|
||||
int ret;
|
||||
|
||||
if (scodec->clk_bus) {
|
||||
ret = clk_prepare_enable(scodec->clk_bus);
|
||||
if (ret) {
|
||||
dev_err(dev, "Failed to enable the bus clock\n");
|
||||
return ret;
|
||||
}
|
||||
ret = clk_prepare_enable(scodec->clk_bus);
|
||||
if (ret) {
|
||||
dev_err(dev, "Failed to enable the bus clock\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
regcache_cache_only(scodec->regmap, false);
|
||||
|
|
@ -274,8 +272,7 @@ static int sun8i_codec_runtime_suspend(struct device *dev)
|
|||
regcache_cache_only(scodec->regmap, true);
|
||||
regcache_mark_dirty(scodec->regmap);
|
||||
|
||||
if (scodec->clk_bus)
|
||||
clk_disable_unprepare(scodec->clk_bus);
|
||||
clk_disable_unprepare(scodec->clk_bus);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user