From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Shuah Khan <shuah.kh@samsung.com>
Cc: gregkh@linuxfoundation.org, shuahkhan@gmail.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] driver: Add Legacy PM OPS usage check and warning to driver_register()
Date: Tue, 24 Dec 2013 01:51:27 +0100 [thread overview]
Message-ID: <1868309.7dxduFC77U@vostro.rjw.lan> (raw)
In-Reply-To: <b33c1967bdaed9a36fa5a6d7855310c84cb9b910.1383868060.git.shuah.kh@samsung.com>
On Thursday, November 07, 2013 05:03:50 PM Shuah Khan wrote:
> Add Legacy PM OPS usage checks to driver_register() function. If Legacy PM OPS
> usage is found, print warning message to indicate 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@samsung.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..10ff280 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("Please update driver '%s' to use dev pm ops.\n",
> + drv->name);
What about the following message instead:
pr_warn("Driver '%s' needs updating - please use the pm pointer.\n",
drv->name);
And analogously for bus types and classes?
> +
> other = driver_find(drv->name, drv->bus);
> if (other) {
> printk(KERN_ERR "Error: Driver '%s' is already registered, "
>
Thanks!
--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
next prev parent reply other threads:[~2013-12-24 0:38 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-08 0:03 [PATCH 0/3] Add Legacy PM OPS usage checks to class, bus, and driver register functions Shuah Khan
2013-11-08 0:03 ` [PATCH 1/3] drivers/bus: Add Legacy PM OPS usage check and warning to bus_register() Shuah Khan
2013-11-08 0:03 ` [PATCH 2/3] drivers/class: Add Legacy PM OPS usage check and warning to __class_register() Shuah Khan
2013-11-08 0:03 ` [PATCH 3/3] driver: Add Legacy PM OPS usage check and warning to driver_register() Shuah Khan
2013-12-24 0:51 ` Rafael J. Wysocki [this message]
2014-01-02 22:59 ` Shuah Khan
2013-11-14 15:43 ` [PATCH 0/3] Add Legacy PM OPS usage checks to class, bus, and driver register functions Shuah Khan
2013-11-14 21:50 ` Rafael J. Wysocki
2013-12-11 6:53 ` Greg KH
2013-11-15 2:09 ` Greg KH
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=1868309.7dxduFC77U@vostro.rjw.lan \
--to=rjw@rjwysocki.net \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=shuah.kh@samsung.com \
--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
all inboxes | Powered by JetHome®