[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <d3beb1b236ab235e340ecbdecaf3ab14b071b74f.1389034060.git.shuah.kh@samsung.com>
Date: Mon, 6 Jan 2014 13:03:23 -0700
From: Shuah Khan <shuah.kh@...sung.com>
To: gregkh@...uxfoundation.org, rjw@...ysocki.net
Cc: Shuah Khan <shuah.kh@...sung.com>, shuahkhan@...il.com,
linux-kernel@...r.kernel.org
Subject: [PATCH v2 3/3] driver: Add Legacy PM OPS usage check and warning to driver_register()
Add Legacy PM OPS usage checks to driver_register() function. If Legacy PM OPS
usage is found, print warning message to indicate that the driver code needs
updating to use Dev PM OPS interfaces. This will help serve as a way to track
drivers that still use Legacy PM OPS and fix them.
The Legacy PM OPS check looks for suspend(struct device *, pm_message_t) or
resume(struct device *) struct device_driver interfaces.
Signed-off-by: Shuah Khan <shuah.kh@...sung.com>
---
drivers/base/driver.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/base/driver.c b/drivers/base/driver.c
index 9e29943..7838a8a 100644
--- a/drivers/base/driver.c
+++ b/drivers/base/driver.c
@@ -157,6 +157,10 @@ int driver_register(struct device_driver *drv)
printk(KERN_WARNING "Driver '%s' needs updating - please use "
"bus_type methods\n", drv->name);
+ if (drv->suspend || drv->resume)
+ pr_warn("Driver '%s' needs updating - use pm pointer.\n",
+ drv->name);
+
other = driver_find(drv->name, drv->bus);
if (other) {
printk(KERN_ERR "Error: Driver '%s' is already registered, "
--
1.8.3.2
--
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