/* Returns 1 if the value is changed, 0 if no change, or a negative code on failure.  */
int snd_ac97_update(struct snd_ac97 *ac97, unsigned short reg, unsigned short value)
/* Returns 1 if the value is changed, 0 if no change, or a negative code on failure.  */
int snd_ac97_update(struct snd_ac97 *ac97, unsigned short reg, unsigned short value)
{
	int change;
	if (!snd_ac97_valid_reg(ac97, reg))
		return -EINVAL;
	mutex_lock(&ac97->reg_mutex);
	change = ac97->regs[reg] != value;
	if (change) {
		ac97->regs[reg] = value;
		ac97->bus->ops->write(ac97, reg, value);
	}
	set_bit(reg, ac97->reg_accessed);
	mutex_unlock(&ac97->reg_mutex);
	return change;
}