lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Mon, 28 Nov 2011 14:56:15 -0800
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Yauhen Kharuzhy <jekhor@...il.com>
Cc:	Alessandro Zummo <a.zummo@...ertech.it>,
	rtc-linux@...glegroups.com, linux-kernel@...r.kernel.org,
	Daniel Mack <daniel@...aq.de>
Subject: Re: [PATCH 2/2] RTC MXC: Make alarm working

On Sun,  6 Nov 2011 19:46:46 +0300
Yauhen Kharuzhy <jekhor@...il.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:

--- 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 = {
_

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ