TAS2770_PWR_CTRL,
                TAS2770_PWR_CTRL_MASK,
                TAS2770_PWR_CTRL_SHUTDOWN);
-       if (ret)
+
+       if (ret < 0)
                return ret;
 
        return 0;
                TAS2770_PWR_CTRL,
                TAS2770_PWR_CTRL_MASK,
                TAS2770_PWR_CTRL_ACTIVE);
-       if (ret)
-               return -EINVAL;
+
+       if (ret < 0)
+               return ret;
 
        return 0;
 }
        }
 
 end:
-       return ret;
+       if (ret < 0)
+               return ret;
+
+       return 0;
 }
 
 static const struct snd_kcontrol_new isense_switch =
                        TAS2770_PWR_CTRL_MASK,
                        TAS2770_PWR_CTRL_ACTIVE);
 
-       return ret;
+       if (ret < 0)
+               return ret;
+
+       return 0;
 }
 
 static int tas2770_set_bitwidth(struct tas2770_priv *tas2770, int bitwidth)
                tas2770->i_sense_slot);
 
 end:
-       return ret;
+       if (ret < 0)
+               return ret;
+
+       return 0;
 }
 
 static int tas2770_set_samplerate(struct tas2770_priv *tas2770, int samplerate)
        }
 
 end:
-       if (!ret)
-               tas2770->sampling_rate = samplerate;
-       return ret;
+       if (ret < 0)
+               return ret;
+
+       tas2770->sampling_rate = samplerate;
+       return 0;
 }
 
 static int tas2770_hw_params(struct snd_pcm_substream *substream,
        ret = snd_soc_component_update_bits(component, TAS2770_TDM_CFG_REG1,
                TAS2770_TDM_CFG_REG1_RX_MASK,
                asi_cfg_1);
-       if (ret)
+       if (ret < 0)
                return ret;
 
        switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
        ret = snd_soc_component_update_bits(component, TAS2770_TDM_CFG_REG1,
                TAS2770_TDM_CFG_REG1_MASK,
        (tdm_rx_start_slot << TAS2770_TDM_CFG_REG1_51_SHIFT));
-       if (ret)
+       if (ret < 0)
                return ret;
 
        tas2770->asi_format = fmt;
        ret = snd_soc_component_update_bits(component, TAS2770_TDM_CFG_REG3,
                TAS2770_TDM_CFG_REG3_30_MASK,
                (left_slot << TAS2770_TDM_CFG_REG3_30_SHIFT));
-       if (ret)
+       if (ret < 0)
                return ret;
        ret = snd_soc_component_update_bits(component, TAS2770_TDM_CFG_REG3,
                TAS2770_TDM_CFG_REG3_RXS_MASK,
        (right_slot << TAS2770_TDM_CFG_REG3_RXS_SHIFT));
-       if (ret)
+       if (ret < 0)
                return ret;
 
        switch (slot_width) {
                ret = -EINVAL;
        }
 
-       if (!ret)
-               tas2770->slot_width = slot_width;
+       if (ret < 0)
+               return ret;
 
-       return ret;
+       tas2770->slot_width = slot_width;
+       return 0;
 }
 
 static struct snd_soc_dai_ops tas2770_dai_ops = {