summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/madera.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/madera.c')
-rw-r--r--sound/soc/codecs/madera.c49
1 files changed, 10 insertions, 39 deletions
diff --git a/sound/soc/codecs/madera.c b/sound/soc/codecs/madera.c
index ec380b0b2d4e..680f31a6493a 100644
--- a/sound/soc/codecs/madera.c
+++ b/sound/soc/codecs/madera.c
@@ -628,12 +628,8 @@ int madera_out1_demux_get(struct snd_kcontrol *kcontrol,
struct snd_soc_component *component =
snd_soc_dapm_kcontrol_component(kcontrol);
unsigned int val;
- int ret;
-
- ret = snd_soc_component_read(component, MADERA_OUTPUT_ENABLES_1, &val);
- if (ret)
- return ret;
+ val = snd_soc_component_read(component, MADERA_OUTPUT_ENABLES_1);
val &= MADERA_EP_SEL_MASK;
val >>= MADERA_EP_SEL_SHIFT;
ucontrol->value.enumerated.item[0] = val;
@@ -1068,12 +1064,7 @@ int madera_rate_put(struct snd_kcontrol *kcontrol,
*/
mutex_lock(&priv->rate_lock);
- ret = snd_soc_component_read(component, e->reg, &val);
- if (ret < 0) {
- dev_warn(priv->madera->dev, "Failed to read 0x%x (%d)\n",
- e->reg, ret);
- goto out;
- }
+ val = snd_soc_component_read(component, e->reg);
val >>= e->shift_l;
val &= e->mask;
if (snd_soc_enum_item_to_val(e, item) == val) {
@@ -2178,10 +2169,7 @@ int madera_dfc_put(struct snd_kcontrol *kcontrol,
snd_soc_dapm_mutex_lock(dapm);
- ret = snd_soc_component_read(component, reg, &val);
- if (ret)
- goto exit;
-
+ val = snd_soc_component_read(component, reg);
if (val & MADERA_DFC1_ENA) {
ret = -EBUSY;
dev_err(component->dev, "Can't change mode on an active DFC\n");
@@ -2211,9 +2199,7 @@ int madera_lp_mode_put(struct snd_kcontrol *kcontrol,
snd_soc_dapm_mutex_lock(dapm);
/* Cannot change lp mode on an active input */
- ret = snd_soc_component_read(component, MADERA_INPUT_ENABLES, &val);
- if (ret)
- goto exit;
+ val = snd_soc_component_read(component, MADERA_INPUT_ENABLES);
mask = (mc->reg - MADERA_ADC_DIGITAL_VOLUME_1L) / 4;
mask ^= 0x1; /* Flip bottom bit for channel order */
@@ -2276,7 +2262,6 @@ int madera_in_ev(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol,
struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
struct madera_priv *priv = snd_soc_component_get_drvdata(component);
unsigned int reg, val;
- int ret;
if (w->shift % 2)
reg = MADERA_ADC_DIGITAL_VOLUME_1L + ((w->shift / 2) * 8);
@@ -2305,9 +2290,8 @@ int madera_in_ev(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol,
break;
case SND_SOC_DAPM_POST_PMD:
/* Disable volume updates if no inputs are enabled */
- ret = snd_soc_component_read(component, MADERA_INPUT_ENABLES,
- &val);
- if (!ret && !val)
+ val = snd_soc_component_read(component, MADERA_INPUT_ENABLES);
+ if (!val)
madera_in_set_vu(priv, false);
break;
default:
@@ -3087,26 +3071,16 @@ static int madera_aif_cfg_changed(struct snd_soc_component *component,
int base, int bclk, int lrclk, int frame)
{
unsigned int val;
- int ret;
- ret = snd_soc_component_read(component, base + MADERA_AIF_BCLK_CTRL,
- &val);
- if (ret)
- return ret;
+ val = snd_soc_component_read(component, base + MADERA_AIF_BCLK_CTRL);
if (bclk != (val & MADERA_AIF1_BCLK_FREQ_MASK))
return 1;
- ret = snd_soc_component_read(component, base + MADERA_AIF_RX_BCLK_RATE,
- &val);
- if (ret)
- return ret;
+ val = snd_soc_component_read(component, base + MADERA_AIF_RX_BCLK_RATE);
if (lrclk != (val & MADERA_AIF1RX_BCPF_MASK))
return 1;
- ret = snd_soc_component_read(component, base + MADERA_AIF_FRAME_CTRL_1,
- &val);
- if (ret)
- return ret;
+ val = snd_soc_component_read(component, base + MADERA_AIF_FRAME_CTRL_1);
if (frame != (val & (MADERA_AIF1TX_WL_MASK |
MADERA_AIF1TX_SLOT_LEN_MASK)))
return 1;
@@ -3162,10 +3136,7 @@ static int madera_hw_params(struct snd_pcm_substream *substream,
}
/* Force multiple of 2 channels for I2S mode */
- ret = snd_soc_component_read(component, base + MADERA_AIF_FORMAT, &val);
- if (ret)
- return ret;
-
+ val = snd_soc_component_read(component, base + MADERA_AIF_FORMAT);
val &= MADERA_AIF1_FMT_MASK;
if ((channels & 1) && val == MADERA_FMT_I2S_MODE) {
madera_aif_dbg(dai, "Forcing stereo mode\n");