From: Takashi Iwai Subject: Re: [PATCH resend] sound: at73c213: Use dev_pm_ops Date: Thu, 11 Apr 2013 12:01:22 +0200 Message-ID: References: <1365673610-17401-1-git-send-email-lars@metafoo.de> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 8E65626604D for ; Thu, 11 Apr 2013 12:01:23 +0200 (CEST) In-Reply-To: <1365673610-17401-1-git-send-email-lars@metafoo.de> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Lars-Peter Clausen Cc: alsa-devel@alsa-project.org, Hans-Christian Egtvedt List-Id: alsa-devel@alsa-project.org At Thu, 11 Apr 2013 11:46:50 +0200, Lars-Peter Clausen wrote: > > Use dev_pm_ops instead of the deprecated legacy suspend/resume callbacks. > > Signed-off-by: Lars-Peter Clausen Applied now with Hans-Christian's ack. Thanks. Takashi > --- > sound/spi/at73c213.c | 22 +++++++++++++--------- > 1 file changed, 13 insertions(+), 9 deletions(-) > > diff --git a/sound/spi/at73c213.c b/sound/spi/at73c213.c > index 4dd60d8..a1a24b9 100644 > --- a/sound/spi/at73c213.c > +++ b/sound/spi/at73c213.c > @@ -1075,10 +1075,11 @@ out: > return 0; > } > > -#ifdef CONFIG_PM > -static int snd_at73c213_suspend(struct spi_device *spi, pm_message_t msg) > +#ifdef CONFIG_PM_SLEEP > + > +static int snd_at73c213_suspend(struct device *dev) > { > - struct snd_card *card = dev_get_drvdata(&spi->dev); > + struct snd_card *card = dev_get_drvdata(dev); > struct snd_at73c213 *chip = card->private_data; > > ssc_writel(chip->ssc->regs, CR, SSC_BIT(CR_TXDIS)); > @@ -1087,9 +1088,9 @@ static int snd_at73c213_suspend(struct spi_device *spi, pm_message_t msg) > return 0; > } > > -static int snd_at73c213_resume(struct spi_device *spi) > +static int snd_at73c213_resume(struct device *dev) > { > - struct snd_card *card = dev_get_drvdata(&spi->dev); > + struct snd_card *card = dev_get_drvdata(dev); > struct snd_at73c213 *chip = card->private_data; > > clk_enable(chip->board->dac_clk); > @@ -1097,18 +1098,21 @@ static int snd_at73c213_resume(struct spi_device *spi) > > return 0; > } > + > +static SIMPLE_DEV_PM_OPS(at73c213_pm_ops, snd_at73c213_suspend, > + snd_at73c213_resume); > +#define AT73C213_PM_OPS (&at73c213_pm_ops) > + > #else > -#define snd_at73c213_suspend NULL > -#define snd_at73c213_resume NULL > +#define AT73C213_PM_OPS NULL > #endif > > static struct spi_driver at73c213_driver = { > .driver = { > .name = "at73c213", > + .pm = AT73C213_PM_OPS, > }, > .probe = snd_at73c213_probe, > - .suspend = snd_at73c213_suspend, > - .resume = snd_at73c213_resume, > .remove = snd_at73c213_remove, > }; > > -- > 1.8.0 >