Re: [PATCH] Switch atmel_serial to dev_pm_ops

From: Frans Pop
Date: Mon Aug 03 2009 - 12:20:50 EST


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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/