On Tue, Aug 13, 2013 at 8:59 PM, Fabio Estevam <festevam@xxxxxxxxx> wrote: > On Tue, Aug 13, 2013 at 3:59 AM, Peter Chen <hzpeterchen@xxxxxxxxx> wrote: > >> It seems .pm is not NULL if CONFIG_PM_SLEEP is not defined >> which is not the same with former code. > > With SIMPLE_DEV_PM_OPS macro we don't need to define the NULL function variants. > > Take a look at include/linux/pm.h to get a clear picture. But what I see is the &dwc3_pci_dev_pm_ops is not NULL if CONFIG_PM_SLEEP is not defined. static foo(void) {} static goo(void) {} struct dev_pm_ops { int a; int b; }; #define SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) #define SIMPLE_DEV_PM_OPS(name, suspend_fn, resume_fn) \ const struct dev_pm_ops name = { \ SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \ } SIMPLE_DEV_PM_OPS(test_name, foo, goo); void main(void) { printf("the pointer of name is %p\n", &test_name); return; } -- BR, Peter Chen -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html