[alsa-devel] [PATCH] ASoC: Intel: add a status for runtime suspend/resume

Jie, Yang yang.jie at intel.com
Thu Feb 5 09:28:57 CET 2015


> -----Original Message-----
> From: Mark Brown [mailto:broonie at kernel.org]
> Sent: Thursday, February 05, 2015 4:18 AM
> To: Jie, Yang
> Cc: alsa-devel at alsa-project.org; Girdwood, Liam R
> Subject: Re: [PATCH] ASoC: Intel: add a status for runtime suspend/resume
> 
> On Wed, Feb 04, 2015 at 09:42:14PM +0800, Jie Yang wrote:
> 
> > +	else if (pdata->pm_state == HSW_PM_STATE_RTD3)
> > +		goto suspend;
> > +
> 
> >  	sst_hsw_dsp_runtime_sleep(hsw);
> > +
> > +suspend:
> > +	snd_soc_suspend(pdata->soc_card->dev);
> > +	snd_soc_poweroff(pdata->soc_card->dev);
> > +
> >  	pdata->pm_state = HSW_PM_STATE_D3;
> 
> This is a pretty big jump for goto and it's not the usual goto as error handling
> idiom either; it seems better to refactor the code so that this isn't required.
> For example have a runtime PM function which is also called by the system
> suspend path.
[Keyon] OK, thanks, let me refactor it and remove the goto. I don't wan't call runtime PM function in system suspend directly because of the suspend/resume(specially the resume) sequence have slight difference, also for not mixing the RTD3 and D3 status.
Will send updated v2 patch soon.



More information about the Alsa-devel mailing list