lkml.org 
[lkml]   [2009]   [Aug]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] Switch atmel_serial to dev_pm_ops
Date
Albin Tonnerre wrote:
>> Why not
>
>> #define atmel_serial_pm_ops NULL
>
> Because the .pm field is set to the address of atmel_serial_pm_ops, and
> iirc taking the address of NULL is not allowed.

The following construction is possible however (first used by Magnus Damm
for some of the SuperH drivers):

#ifdef CONFIG_PM
[...]
#define DRIVER_PM_OPS (&driver_pm_ops)
#else
#define DRIVER_PM_OPS NULL
#endif

...
.driver = {
...
.pm = DRIVER_PM_OPS,
}
...

Cheers,
FJP


\
 
 \ /
  Last update: 2009-08-03 18:23    [W:0.495 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site