bool init_only)
{
struct hda_amp_info *info;
+ unsigned int cache_only;
if (snd_BUG_ON(mask & ~0xff))
mask &= 0xff;
return 0;
}
info->vol[ch] = val;
- if (codec->cached_write)
- info->head.dirty = 1;
+ cache_only = info->head.dirty = codec->cached_write;
mutex_unlock(&codec->hash_mutex);
- if (!codec->cached_write)
+ if (!cache_only)
put_vol_mute(codec, info, nid, ch, direction, idx, val);
return 1;
}
int err;
struct hda_cache_head *c;
u32 key;
+ unsigned int cache_only;
- if (!codec->cached_write) {
+ cache_only = codec->cached_write;
+ if (!cache_only) {
err = snd_hda_codec_write(codec, nid, direct, verb, parm);
if (err < 0)
return err;
c = get_alloc_hash(&codec->cmd_cache, key);
if (c) {
c->val = parm;
- if (codec->cached_write)
- c->dirty = 1;
+ c->dirty = cache_only;
}
mutex_unlock(&codec->bus->cmd_mutex);
return 0;