lkml.org 
[lkml]   [2014]   [Jan]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/3] driver: Add Legacy PM OPS usage check and warning to driver_register()
On 12/23/2013 05:51 PM, Rafael J. Wysocki wrote:
> 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);

I thought pm ops would be more informative for driver developers. That
said, I will change the message and re-send the patch.

>
> 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!
>


--
Shuah Khan
Senior Linux Kernel Developer - Open Source Group
Samsung Research America(Silicon Valley)
shuah.kh@samsung.com | (970) 672-0658


\
 
 \ /
  Last update: 2014-01-03 00:21    [W:0.055 / U:0.640 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site