From: Andrew Morton With CONFIG_PM=n: drivers/built-in.o(.text+0x1098c): In function `hub_thread': drivers/usb/core/hub.c:2673: undefined reference to `.dpm_runtime_resume' drivers/built-in.o(.text+0x10998):drivers/usb/core/hub.c:2674: undefined reference to `.dpm_runtime_resume' Please, never ever ever put extern decls into .c files. Use the darn header files :( Cc: Greg KH Cc: David Brownell Signed-off-by: Andrew Morton --- drivers/base/power/power.h | 13 ------------- drivers/usb/core/hub.c | 2 -- include/linux/pm.h | 13 +++++++++++++ 3 files changed, 13 insertions(+), 15 deletions(-) diff -puN drivers/usb/core/hub.c~gregkh-usb-usb-pm-04-fix drivers/usb/core/hub.c --- 25/drivers/usb/core/hub.c~gregkh-usb-usb-pm-04-fix 2005-10-24 05:48:45.000000000 -0600 +++ 25-akpm/drivers/usb/core/hub.c 2005-10-24 05:49:50.000000000 -0600 @@ -2668,8 +2668,6 @@ static void hub_events(void) * stub "device" node was never suspended. */ if (i) { - extern void dpm_runtime_resume(struct device *); - dpm_runtime_resume(&hdev->dev); dpm_runtime_resume(&intf->dev); } diff -puN drivers/base/power/power.h~gregkh-usb-usb-pm-04-fix drivers/base/power/power.h --- 25/drivers/base/power/power.h~gregkh-usb-usb-pm-04-fix 2005-10-24 05:50:19.000000000 -0600 +++ 25-akpm/drivers/base/power/power.h 2005-10-24 05:51:52.000000000 -0600 @@ -67,9 +67,6 @@ extern int suspend_device(struct device * runtime.c */ -extern int dpm_runtime_suspend(struct device *, pm_message_t); -extern void dpm_runtime_resume(struct device *); - #else /* CONFIG_PM */ @@ -82,14 +79,4 @@ static inline void device_pm_remove(stru } -static inline int dpm_runtime_suspend(struct device * dev, pm_message_t state) -{ - return 0; -} - -static inline void dpm_runtime_resume(struct device * dev) -{ - -} - #endif diff -puN include/linux/pm.h~gregkh-usb-usb-pm-04-fix include/linux/pm.h --- 25/include/linux/pm.h~gregkh-usb-usb-pm-04-fix 2005-10-24 05:50:24.000000000 -0600 +++ 25-akpm/include/linux/pm.h 2005-10-24 05:51:58.000000000 -0600 @@ -244,6 +244,9 @@ extern int device_suspend(pm_message_t s #define device_may_wakeup(dev) \ (device_can_wakeup(dev) && (dev)->power.should_wakeup) +extern int dpm_runtime_suspend(struct device *, pm_message_t); +extern void dpm_runtime_resume(struct device *); + #else /* !CONFIG_PM */ static inline int device_suspend(pm_message_t state) @@ -254,6 +257,16 @@ static inline int device_suspend(pm_mess #define device_set_wakeup_enable(dev,val) do{}while(0) #define device_may_wakeup(dev) (0) +static inline int dpm_runtime_suspend(struct device * dev, pm_message_t state) +{ + return 0; +} + +static inline void dpm_runtime_resume(struct device * dev) +{ + +} + #endif /* changes to device_may_wakeup take effect on the next pm state change. _