Merge remote-tracking branches 'asoc/topic/rt5670', 'asoc/topic/rt5677', 'asoc/topic...
[cascardo/linux.git] / sound / soc / codecs / wm_adsp.c
index ff67b33..d01c209 100644 (file)
@@ -420,10 +420,9 @@ static int wm_coeff_put(struct snd_kcontrol *kcontrol,
 
        memcpy(ctl->cache, p, ctl->len);
 
-       if (!ctl->enabled) {
-               ctl->set = 1;
+       ctl->set = 1;
+       if (!ctl->enabled)
                return 0;
-       }
 
        return wm_coeff_write_control(kcontrol, p, ctl->len);
 }
@@ -1185,7 +1184,6 @@ static int wm_adsp_load_coeff(struct wm_adsp *dsp)
        int ret, pos, blocks, type, offset, reg;
        char *file;
        struct wm_adsp_buf *buf;
-       int tmp;
 
        file = kzalloc(PAGE_SIZE, GFP_KERNEL);
        if (file == NULL)
@@ -1335,12 +1333,7 @@ static int wm_adsp_load_coeff(struct wm_adsp *dsp)
                        }
                }
 
-               tmp = le32_to_cpu(blk->len) % 4;
-               if (tmp)
-                       pos += le32_to_cpu(blk->len) + (4 - tmp) + sizeof(*blk);
-               else
-                       pos += le32_to_cpu(blk->len) + sizeof(*blk);
-
+               pos += (le32_to_cpu(blk->len) + sizeof(*blk) + 3) & ~0x03;
                blocks++;
        }