[PATCH] ASoC: codecs: pcm6240: Return 0 explicitly on success

From: phucduc . bui

Date: Wed Sep 16 2026 - 02:37:08 EST


From: bui duc phuc <phucduc.bui@xxxxxxxxx>

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@xxxxxxxxx>
Link: https://lore.kernel.org/all/aqfHiX3pE-0BiCt9@stanley.mountain/
Signed-off-by: bui duc phuc <phucduc.bui@xxxxxxxxx>
---
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