* [PATCH] ASoC: codecs: pcm6240: Return 0 explicitly on success
@ 2026-09-16 6:36 phucduc.bui
0 siblings, 0 replies; only message in thread
From: phucduc.bui @ 2026-09-16 6:36 UTC (permalink / raw)
To: Jaroslav Kysela, Takashi Iwai, Liam Girdwood, Mark Brown
Cc: Kees Cook, Kuninori Morimoto, u.kleine-koenig, Rosen Penev,
Dan Carpenter, linux-sound, linux-kernel, bui duc phuc
From: bui duc phuc <phucduc.bui@gmail.com>
The return value of pcmdev_dev_read() is already checked, and
errors are returned immediately. Therefore, the remaining paths
are successful paths and should return 0 explicitly instead of
returning ret.
Reported-by: Dan Carpenter <error27@gmail.com>
Link: https://lore.kernel.org/all/aqfHiX3pE-0BiCt9@stanley.mountain/
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
sound/soc/codecs/pcm6240.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/sound/soc/codecs/pcm6240.c b/sound/soc/codecs/pcm6240.c
index db85ae2f8aed..4b5569a5b062 100644
--- a/sound/soc/codecs/pcm6240.c
+++ b/sound/soc/codecs/pcm6240.c
@@ -620,12 +620,12 @@ static int pcmdev_get_volsw(struct snd_kcontrol *kcontrol,
/* Set to wide-range mode, before using vol ctrl. */
if (!val && vol_ctrl_type == PCMDEV_PCM1690_VOL_CTRL) {
ucontrol->value.integer.value[0] = -25500;
- return ret;
+ return 0;
}
/* Set to fine mode, before using fine vol ctrl. */
if (val && vol_ctrl_type == PCMDEV_PCM1690_FINE_VOL_CTRL) {
ucontrol->value.integer.value[0] = -12750;
- return ret;
+ return 0;
}
}
@@ -641,7 +641,7 @@ static int pcmdev_get_volsw(struct snd_kcontrol *kcontrol,
val = mc->invert ? max - val : val;
ucontrol->value.integer.value[0] = val;
- return ret;
+ return 0;
}
static int pcmdevice_get_volsw(struct snd_kcontrol *kcontrol,
--
2.43.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-09-16 6:36 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-16 6:36 [PATCH] ASoC: codecs: pcm6240: Return 0 explicitly on success phucduc.bui
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®