]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ASoC: soc-ops: makes snd_soc_read_signed() void
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Wed, 12 Feb 2025 02:24:06 +0000 (02:24 +0000)
committerMark Brown <broonie@kernel.org>
Sun, 16 Feb 2025 23:51:02 +0000 (23:51 +0000)
snd_soc_read_signed() never return error. Let's makes it void.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87tt8zyk6x.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/soc-ops.c

index c6601ef16f843b96fa23cbb473a3d0a006e72c21..bb1fbffeef9f82c0dff6e2b9ed4cee805ee05187 100644 (file)
@@ -122,10 +122,8 @@ EXPORT_SYMBOL_GPL(snd_soc_put_enum_double);
  * This functions reads a codec register. The register value is shifted right
  * by 'shift' bits and masked with the given 'mask'. Afterwards it translates
  * the given registervalue into a signed integer if sign_bit is non-zero.
- *
- * Returns 0 on sucess, otherwise an error value
  */
-static int snd_soc_read_signed(struct snd_soc_component *component,
+static void snd_soc_read_signed(struct snd_soc_component *component,
        unsigned int reg, unsigned int mask, unsigned int shift,
        unsigned int sign_bit, int *signed_val)
 {
@@ -137,13 +135,13 @@ static int snd_soc_read_signed(struct snd_soc_component *component,
 
        if (!sign_bit) {
                *signed_val = val;
-               return 0;
+               return;
        }
 
        /* non-negative number */
        if (!(val & BIT(sign_bit))) {
                *signed_val = val;
-               return 0;
+               return;
        }
 
        ret = val;
@@ -157,8 +155,6 @@ static int snd_soc_read_signed(struct snd_soc_component *component,
        ret |= ~((int)(BIT(sign_bit) - 1));
 
        *signed_val = ret;
-
-       return 0;
 }
 
 /**
@@ -266,14 +262,11 @@ int snd_soc_get_volsw(struct snd_kcontrol *kcontrol,
        unsigned int mask = (1ULL << fls(max)) - 1;
        unsigned int invert = mc->invert;
        int val;
-       int ret;
 
        if (sign_bit)
                mask = BIT(sign_bit + 1) - 1;
 
-       ret = snd_soc_read_signed(component, reg, mask, shift, sign_bit, &val);
-       if (ret)
-               return ret;
+       snd_soc_read_signed(component, reg, mask, shift, sign_bit, &val);
 
        ucontrol->value.integer.value[0] = val - min;
        if (invert)
@@ -282,13 +275,9 @@ int snd_soc_get_volsw(struct snd_kcontrol *kcontrol,
 
        if (snd_soc_volsw_is_stereo(mc)) {
                if (reg == reg2)
-                       ret = snd_soc_read_signed(component, reg, mask, rshift,
-                               sign_bit, &val);
+                       snd_soc_read_signed(component, reg, mask, rshift, sign_bit, &val);
                else
-                       ret = snd_soc_read_signed(component, reg2, mask, shift,
-                               sign_bit, &val);
-               if (ret)
-                       return ret;
+                       snd_soc_read_signed(component, reg2, mask, shift, sign_bit, &val);
 
                ucontrol->value.integer.value[1] = val - min;
                if (invert)