From: Kuninori Morimoto Date: Wed, 12 Feb 2025 02:24:06 +0000 (+0000) Subject: ASoC: soc-ops: makes snd_soc_read_signed() void X-Git-Tag: v6.15-rc1~173^2~4^2~108^2~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1248d29464cc682c2a1793cfc5d4ebeb374c6738;p=thirdparty%2Flinux.git ASoC: soc-ops: makes snd_soc_read_signed() void snd_soc_read_signed() never return error. Let's makes it void. Signed-off-by: Kuninori Morimoto Link: https://patch.msgid.link/87tt8zyk6x.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown --- diff --git a/sound/soc/soc-ops.c b/sound/soc/soc-ops.c index c6601ef16f843..bb1fbffeef9f8 100644 --- a/sound/soc/soc-ops.c +++ b/sound/soc/soc-ops.c @@ -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)