Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Chen Ni and committed by
Mark Brown
ad20e1f8 d0e1a832

+5 -8
+5 -8
sound/soc/sunxi/sun8i-codec.c
··· 248 248 struct sun8i_codec *scodec = dev_get_drvdata(dev); 249 249 int ret; 250 250 251 - if (scodec->clk_bus) { 252 - ret = clk_prepare_enable(scodec->clk_bus); 253 - if (ret) { 254 - dev_err(dev, "Failed to enable the bus clock\n"); 255 - return ret; 256 - } 251 + ret = clk_prepare_enable(scodec->clk_bus); 252 + if (ret) { 253 + dev_err(dev, "Failed to enable the bus clock\n"); 254 + return ret; 257 255 } 258 256 259 257 regcache_cache_only(scodec->regmap, false); ··· 272 274 regcache_cache_only(scodec->regmap, true); 273 275 regcache_mark_dirty(scodec->regmap); 274 276 275 - if (scodec->clk_bus) 276 - clk_disable_unprepare(scodec->clk_bus); 277 + clk_disable_unprepare(scodec->clk_bus); 277 278 278 279 return 0; 279 280 }