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]
Message-Id: <20101022130324.ce4ec019.akpm@linux-foundation.org>
Date:	Fri, 22 Oct 2010 13:03:24 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Alan Cox <alan@...rguk.ukuu.org.uk>
Cc:	linux-kernel@...r.kernel.org, Hong Liu <hong.liu@...el.com>
Subject: Re: [PATCH] apds9802als: add runtime PM support

On Fri, 15 Oct 2010 14:47:25 +0100
Alan Cox <alan@...rguk.ukuu.org.uk> wrote:

>     Update the driver for the needed runtime power features. Remove the old
>     user controlled power functions.

How's this look?



put PM code under CONFIG_PM

Cc: Alan Cox <alan@...ux.intel.com>
Cc: Hong Liu <hong.liu@...el.com>
Signed-off-by: Andrew Morton <akpm@...ux-foundation.org>
---

 drivers/misc/apds9802als.c |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff -puN drivers/misc/apds9802als.c~drivers-misc-apds9802alsc-add-runtime-pm-support-fix drivers/misc/apds9802als.c
--- a/drivers/misc/apds9802als.c~drivers-misc-apds9802alsc-add-runtime-pm-support-fix
+++ a/drivers/misc/apds9802als.c
@@ -266,6 +266,7 @@ static int apds9802als_remove(struct i2c
 	return 0;
 }
 
+#ifdef CONFIG_PM
 static int apds9802als_suspend(struct i2c_client *client, pm_message_t mesg)
 {
 	als_set_power_state(client, false);
@@ -302,6 +303,14 @@ static const struct dev_pm_ops apds9802a
 	.runtime_resume = apds9802als_runtime_resume,
 };
 
+#define APDS9802ALS_PM_OPS (&apds9802als_pm_ops)
+
+#else	/* CONFIG_PM */
+#define apds9802als_suspend NULL
+#define apds9802als_resume NULL
+#define APDS9802ALS_PM_OPS NULL
+#endif	/* CONFIG_PM */
+
 static struct i2c_device_id apds9802als_id[] = {
 	{ DRIVER_NAME, 0 },
 	{ }
@@ -312,7 +321,7 @@ MODULE_DEVICE_TABLE(i2c, apds9802als_id)
 static struct i2c_driver apds9802als_driver = {
 	.driver = {
 		.name = DRIVER_NAME,
-		.pm = &apds9802als_pm_ops,
+		.pm = APDS9802ALS_PM_OPS,
 	},
 	.probe = apds9802als_probe,
 	.remove = apds9802als_remove,
_


And a question.  This driver puts the .suspend and .resume pointers
into the `struct i2c_driver'.  However drivers/misc/isl29020.c does not
do that.  What's up with that?
--
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