Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ddd2a30d authored by Lars-Peter Clausen's avatar Lars-Peter Clausen Committed by Linus Torvalds
Browse files

drivers/rtc/rtc-mrst: fix suspend/resume



The Moorestown RTC driver implements suspend and resume callbacks and
assigns them to the suspend and resume fields of the device_driver
struct.  These callbacks are never actually called by anything though.

Modify the driver to properly use dev_pm_ops so that the suspend and
resume functions are actually executed upon suspend/resume.

[akpm@linux-foundation.org: device_driver.name is const char *]
Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Feng Tang <feng.tang@intel.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent fb903811
Loading
Loading
Loading
Loading
+9 −8
Original line number Original line Diff line number Diff line
@@ -413,8 +413,8 @@ static void rtc_mrst_do_remove(struct device *dev)
	mrst->dev = NULL;
	mrst->dev = NULL;
}
}


#ifdef	CONFIG_PM
#ifdef CONFIG_PM_SLEEP
static int mrst_suspend(struct device *dev, pm_message_t mesg)
static int mrst_suspend(struct device *dev)
{
{
	struct mrst_rtc	*mrst = dev_get_drvdata(dev);
	struct mrst_rtc	*mrst = dev_get_drvdata(dev);
	unsigned char	tmp;
	unsigned char	tmp;
@@ -453,7 +453,7 @@ static int mrst_suspend(struct device *dev, pm_message_t mesg)
 */
 */
static inline int mrst_poweroff(struct device *dev)
static inline int mrst_poweroff(struct device *dev)
{
{
	return mrst_suspend(dev, PMSG_HIBERNATE);
	return mrst_suspend(dev);
}
}


static int mrst_resume(struct device *dev)
static int mrst_resume(struct device *dev)
@@ -490,9 +490,11 @@ static int mrst_resume(struct device *dev)
	return 0;
	return 0;
}
}


static SIMPLE_DEV_PM_OPS(mrst_pm_ops, mrst_suspend, mrst_resume);
#define MRST_PM_OPS (&mrst_pm_ops)

#else
#else
#define	mrst_suspend	NULL
#define MRST_PM_OPS NULL
#define	mrst_resume	NULL


static inline int mrst_poweroff(struct device *dev)
static inline int mrst_poweroff(struct device *dev)
{
{
@@ -529,9 +531,8 @@ static struct platform_driver vrtc_mrst_platform_driver = {
	.remove		= vrtc_mrst_platform_remove,
	.remove		= vrtc_mrst_platform_remove,
	.shutdown	= vrtc_mrst_platform_shutdown,
	.shutdown	= vrtc_mrst_platform_shutdown,
	.driver = {
	.driver = {
		.name		= (char *) driver_name,
		.name	= driver_name,
		.suspend	= mrst_suspend,
		.pm	= MRST_PM_OPS,
		.resume		= mrst_resume,
	}
	}
};
};