mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Daniel Drake <dsd@laptop.org>
Cc: a.zummo@towertech.it, rtc-linux@googlegroups.com,
	linux-kernel@vger.kernel.org, pgf@laptop.org
Subject: Re: [PATCH] rtc-cmos: fix suspend/resume
Date: Thu, 16 Dec 2010 22:08:19 +0100	[thread overview]
Message-ID: <201012162208.19868.rjw@sisk.pl> (raw)
In-Reply-To: <201012162205.39435.rjw@sisk.pl>

On Thursday, December 16, 2010, Rafael J. Wysocki wrote:
> On Thursday, December 16, 2010, Daniel Drake wrote:
> > From: Paul Fox <pgf@laptop.org>
> > 
> > rtc-cmos was setting suspend/resume hooks at the device_driver level.
> > However, the platform bus code (drivers/base/platform.c) only looks
> > for resume hooks at the dev_pm_ops level, or within the platform_driver.
> > 
> > Switch rtc_cmos to use dev_pm_ops so that suspend/resume code is
> > executed again.
> > 
> > Signed-off-by: Paul Fox <pgf@laptop.org>
> > Signed-off-by: Daniel Drake <dsd@laptop.org>
> > ---
> >  drivers/rtc/rtc-cmos.c |   14 +++++++++-----
> >  1 files changed, 9 insertions(+), 5 deletions(-)
> > 
> > diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c
> > index 5856167..dfa5547 100644
> > --- a/drivers/rtc/rtc-cmos.c
> > +++ b/drivers/rtc/rtc-cmos.c
> > @@ -850,7 +850,7 @@ static void __exit cmos_do_remove(struct device *dev)
> >  
> >  #ifdef	CONFIG_PM
> >  
> > -static int cmos_suspend(struct device *dev, pm_message_t mesg)
> > +static int cmos_suspend(struct device *dev)
> >  {
> >  	struct cmos_rtc	*cmos = dev_get_drvdata(dev);
> >  	unsigned char	tmp;
> > @@ -898,7 +898,7 @@ static int cmos_suspend(struct device *dev, pm_message_t mesg)
> >   */
> >  static inline int cmos_poweroff(struct device *dev)
> >  {
> > -	return cmos_suspend(dev, PMSG_HIBERNATE);
> > +	return cmos_suspend(dev);
> >  }
> >  
> >  static int cmos_resume(struct device *dev)
> > @@ -1077,7 +1077,7 @@ static void __exit cmos_pnp_remove(struct pnp_dev *pnp)
> >  
> >  static int cmos_pnp_suspend(struct pnp_dev *pnp, pm_message_t mesg)
> >  {
> > -	return cmos_suspend(&pnp->dev, mesg);
> > +	return cmos_suspend(&pnp->dev);
> >  }
> >  
> >  static int cmos_pnp_resume(struct pnp_dev *pnp)
> > @@ -1152,13 +1152,17 @@ static void cmos_platform_shutdown(struct platform_device *pdev)
> >  /* work with hotplug and coldplug */
> >  MODULE_ALIAS("platform:rtc_cmos");
> >  
> > +static struct dev_pm_ops cmos_pm_ops = {
> > +	.suspend = cmos_suspend,
> > +	.resume = cmos_resume,
> > +};
> 
> That's not enough.  Please also specify hibernation callbacks as documented
> in Documentation/power/devices.txt (they can point to the same routines as the
> suspend/resume ones).

You can use the SIMPLE_DEV_PM_OPS() macro (defined in include/linux/pm.h)
for this purpose.

Thanks,
Rafael


> > +
> >  static struct platform_driver cmos_platform_driver = {
> >  	.remove		= __exit_p(cmos_platform_remove),
> >  	.shutdown	= cmos_platform_shutdown,
> >  	.driver = {
> >  		.name		= (char *) driver_name,
> > -		.suspend	= cmos_suspend,
> > -		.resume		= cmos_resume,
> > +		.pm = &cmos_pm_ops,
> >  	}
> >  };
> >  
> > 
> 
> 


      reply	other threads:[~2010-12-16 21:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-16 18:08 Daniel Drake
2010-12-16 21:05 ` Rafael J. Wysocki
2010-12-16 21:08   ` Rafael J. Wysocki [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201012162208.19868.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=a.zummo@towertech.it \
    --cc=dsd@laptop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pgf@laptop.org \
    --cc=rtc-linux@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®