[alsa-devel] [PATCH 2/2] ASoC: cs4270: add power management support

Daniel Mack daniel at caiaq.de
Tue May 5 17:51:16 CEST 2009


On Tue, May 05, 2009 at 10:30:48AM -0500, Timur Tabi wrote:
> > +static int cs4270_i2c_suspend(struct i2c_client *client, pm_message_t mesg)
> > +{
> > +	struct cs4270_private *cs4270 = i2c_get_clientdata(client);
> > +	struct snd_soc_codec *codec = &cs4270->codec;
> > +	int reg = snd_soc_read(codec, CS4270_PWRCTL);
> > +
> > +	if (reg < 0)
> > +		return reg;
> 
> You check for an error code from snd_soc_read() here, but ...
> 
> > +	/* ... then disable the power-down bits */
> > +	reg = snd_soc_read(codec, CS4270_PWRCTL);
> 
> you don't check for it here.
> 
> In cs4270_i2c_suspend(), snd_soc_read() can never return an error,
> because you're passing a hard-coded register address.

Ok - see the patch below.

Thanks,
Daniel




More information about the Alsa-devel mailing list