OSDN Git Service

ASoC: sti-sas: Remove the unneeded result variable
authorye xingchen <ye.xingchen@zte.com.cn>
Thu, 8 Sep 2022 01:03:04 +0000 (01:03 +0000)
committerMark Brown <broonie@kernel.org>
Thu, 8 Sep 2022 10:39:43 +0000 (11:39 +0100)
Return the value regmap_write() and sti_sas_init_sas_registers() directly
instead of storing it in another redundant variable.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
Link: https://lore.kernel.org/r/20220908010304.342760-1-ye.xingchen@zte.com.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/sti-sas.c

index f076878..99545bc 100644 (file)
@@ -96,11 +96,8 @@ static int sti_sas_write_reg(void *context, unsigned int reg,
                             unsigned int value)
 {
        struct sti_sas_data *drvdata = context;
-       int status;
-
-       status = regmap_write(drvdata->dac.regmap, reg, value);
 
-       return status;
+       return regmap_write(drvdata->dac.regmap, reg, value);
 }
 
 static int  sti_sas_init_sas_registers(struct snd_soc_component *component,
@@ -385,11 +382,8 @@ static int sti_sas_resume(struct snd_soc_component *component)
 static int sti_sas_component_probe(struct snd_soc_component *component)
 {
        struct sti_sas_data *drvdata = dev_get_drvdata(component->dev);
-       int ret;
 
-       ret = sti_sas_init_sas_registers(component, drvdata);
-
-       return ret;
+       return sti_sas_init_sas_registers(component, drvdata);
 }
 
 static struct snd_soc_component_driver sti_sas_driver = {