linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shuah Khan <shuah.kh@samsung.com>
To: gregkh@linuxfoundation.org, rjw@rjwysocki.net
Cc: Shuah Khan <shuah.kh@samsung.com>,
	shuahkhan@gmail.com, linux-kernel@vger.kernel.org
Subject: [PATCH v2 2/3] drivers/class: Add Legacy PM OPS usage check and warning to __class_register()
Date: Mon,  6 Jan 2014 13:03:22 -0700	[thread overview]
Message-ID: <480191469165334594d1027fb2ccae68d7fb71a9.1389034060.git.shuah.kh@samsung.com> (raw)
In-Reply-To: <cover.1389034060.git.shuah.kh@samsung.com>
In-Reply-To: <cover.1389034060.git.shuah.kh@samsung.com>

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


  parent reply	other threads:[~2014-01-06 20:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-06 20:03 [PATCH v2 0/3] Add Legacy PM OPS usage checks to class, bus, and driver register functions Shuah Khan
2014-01-06 20:03 ` [PATCH v2 1/3] drivers/bus: Add Legacy PM OPS usage check and warning to bus_register() Shuah Khan
2014-01-06 20:17   ` Greg KH
2014-01-06 20:30     ` Shuah Khan
2014-01-06 21:29       ` Greg KH
2014-01-06 21:44         ` Shuah Khan
2014-01-06 20:03 ` Shuah Khan [this message]
2014-01-06 20:03 ` [PATCH v2 3/3] driver: Add Legacy PM OPS usage check and warning to driver_register() Shuah Khan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=480191469165334594d1027fb2ccae68d7fb71a9.1389034060.git.shuah.kh@samsung.com \
    --to=shuah.kh@samsung.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=shuahkhan@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).