Patchwork Re: [PATCH 2/2] RTC MXC: Make alarm working

login
register
mail settings
Submitter Andrew Morton
Date Nov. 28, 2011, 10:56 p.m.
Message ID <20111128145615.98789cfc.akpm@linux-foundation.org>
Download mbox | patch
Permalink /patch/128101/
State New
Headers show

Comments

Andrew Morton - Nov. 28, 2011, 10:56 p.m.
On Sun,  6 Nov 2011 19:46:46 +0300
Yauhen Kharuzhy <jekhor@gmail.com> wrote:

> Fix alarm IRQ handling, make the alarm one-shot. Cleanup black magick with
> a validation of already validated time data.
> 
> Add ability to wake the system with alarm.
> 
> ...
>
> +#ifdef CONFIG_PM
> +static int mxc_rtc_suspend(struct device *dev)
> +{
> +	struct rtc_plat_data *pdata = dev_get_drvdata(dev);
> +
> +	if (device_may_wakeup(dev))
> +		enable_irq_wake(pdata->irq);
> +
> +	return 0;
> +}
> +
> +static int mxc_rtc_resume(struct device *dev)
> +{
> +	struct rtc_plat_data *pdata = dev_get_drvdata(dev);
> +
> +	if (device_may_wakeup(dev))
> +		disable_irq_wake(pdata->irq);
> +
> +	return 0;
> +}
> +#endif
> +
> +static struct dev_pm_ops mxc_rtc_pm_ops = {
> +	.suspend	= mxc_rtc_suspend,
> +	.resume		= mxc_rtc_resume,
> +};
> +
>  static struct platform_driver mxc_rtc_driver = {
>  	.driver = {
>  		   .name	= "mxc_rtc",
> +#ifdef CONFIG_PM
> +		   .pm		= &mxc_rtc_pm_ops,
> +#endif
>  		   .owner	= THIS_MODULE,
>  	},
>  	.remove		= __exit_p(mxc_rtc_remove),

This won't compile with CONFIG_PM=n.  Fix:

Patch

--- a/drivers/rtc/rtc-mxc.c~drivers-rtc-rtc-mxcc-make-alarm-work-fix
+++ a/drivers/rtc/rtc-mxc.c
@@ -466,12 +466,12 @@  static int mxc_rtc_resume(struct device 
 
 	return 0;
 }
-#endif
 
 static struct dev_pm_ops mxc_rtc_pm_ops = {
 	.suspend	= mxc_rtc_suspend,
 	.resume		= mxc_rtc_resume,
 };
+#endif
 
 static struct platform_driver mxc_rtc_driver = {
 	.driver = {