lkml.org 
[lkml]   [2014]   [Jan]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2 2/3] drivers/class: Add Legacy PM OPS usage check and warning to __class_register()
Date
Add Legacy PM OPS usage checks to __class_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 *) class level interfaces.

Signed-off-by: Shuah Khan <shuah.kh@samsung.com>
---
drivers/base/class.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/drivers/base/class.c b/drivers/base/class.c
index f96f704..2f20be5 100644
--- a/drivers/base/class.c
+++ b/drivers/base/class.c
@@ -169,6 +169,10 @@ int __class_register(struct class *cls, struct lock_class_key *key)

pr_debug("device class '%s': registering\n", cls->name);

+ if (cls->suspend || cls->resume)
+ pr_warn("device class '%s' needs updating - use pm pointer.\n",
+ cls->name);
+
cp = kzalloc(sizeof(*cp), GFP_KERNEL);
if (!cp)
return -ENOMEM;
--
1.8.3.2


\
 
 \ /
  Last update: 2014-01-06 22:01    [W:0.861 / U:0.228 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site