summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm8978.c
diff options
context:
space:
mode:
authorShang XiaoJing <shangxiaojing@huawei.com>2022-09-27 22:09:46 +0800
committerMark Brown <broonie@kernel.org>2022-10-17 12:48:22 +0100
commitc54402609820427ff6f725f9182216e7cfe7cfa7 (patch)
tree409028bc3438fd480594e207141f9fd8c3f03f5b /sound/soc/codecs/wm8978.c
parentff091dd23b423e19c8191928daedf62eab6ce523 (diff)
downloadlinux-c54402609820427ff6f725f9182216e7cfe7cfa7.tar.bz2
ASoC: wm8978: Use DIV_ROUND_UP() instead of open-coding it
Use DIV_ROUND_UP() instead of open-coding it, which intents and makes it more clear what is going on for the casual reviewer. The Coccinelle references Commit e4d8aef21403 ("ALSA: usb: Use DIV_ROUND_UP() instead of open-coding it"). Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com> Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20220927140948.17696-3-shangxiaojing@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/wm8978.c')
-rw-r--r--sound/soc/codecs/wm8978.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/soc/codecs/wm8978.c b/sound/soc/codecs/wm8978.c
index a682f8020eb6..aa2f55401a88 100644
--- a/sound/soc/codecs/wm8978.c
+++ b/sound/soc/codecs/wm8978.c
@@ -498,7 +498,7 @@ static int wm8978_configure_pll(struct snd_soc_component *component)
if (4 * f_opclk < 3 * f_mclk)
/* Have to use OPCLKDIV */
- opclk_div = (3 * f_mclk / 4 + f_opclk - 1) / f_opclk;
+ opclk_div = DIV_ROUND_UP(3 * f_mclk / 4, f_opclk);
else
opclk_div = 1;