Commit 9a7834d06d553d02cc6e659e94772f69a8b5367f
Committed by
Greg Kroah-Hartman
1 parent
db2d55b7f7
Exists in
master
and in
4 other branches
[PATCH] USB: fix pm patches with CONFIG_PM off part 2
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: David Brownell <david-b@pacbell.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Showing 3 changed files with 13 additions and 15 deletions Side-by-side Diff
drivers/base/power/power.h
... | ... | @@ -67,9 +67,6 @@ |
67 | 67 | * runtime.c |
68 | 68 | */ |
69 | 69 | |
70 | -extern int dpm_runtime_suspend(struct device *, pm_message_t); | |
71 | -extern void dpm_runtime_resume(struct device *); | |
72 | - | |
73 | 70 | #else /* CONFIG_PM */ |
74 | 71 | |
75 | 72 | |
... | ... | @@ -78,16 +75,6 @@ |
78 | 75 | return 0; |
79 | 76 | } |
80 | 77 | static inline void device_pm_remove(struct device * dev) |
81 | -{ | |
82 | - | |
83 | -} | |
84 | - | |
85 | -static inline int dpm_runtime_suspend(struct device * dev, pm_message_t state) | |
86 | -{ | |
87 | - return 0; | |
88 | -} | |
89 | - | |
90 | -static inline void dpm_runtime_resume(struct device * dev) | |
91 | 78 | { |
92 | 79 | |
93 | 80 | } |
drivers/usb/core/hub.c
include/linux/pm.h
... | ... | @@ -243,6 +243,9 @@ |
243 | 243 | #define device_may_wakeup(dev) \ |
244 | 244 | (device_can_wakeup(dev) && (dev)->power.should_wakeup) |
245 | 245 | |
246 | +extern int dpm_runtime_suspend(struct device *, pm_message_t); | |
247 | +extern void dpm_runtime_resume(struct device *); | |
248 | + | |
246 | 249 | #else /* !CONFIG_PM */ |
247 | 250 | |
248 | 251 | static inline int device_suspend(pm_message_t state) |
... | ... | @@ -252,6 +255,16 @@ |
252 | 255 | |
253 | 256 | #define device_set_wakeup_enable(dev,val) do{}while(0) |
254 | 257 | #define device_may_wakeup(dev) (0) |
258 | + | |
259 | +static inline int dpm_runtime_suspend(struct device * dev, pm_message_t state) | |
260 | +{ | |
261 | + return 0; | |
262 | +} | |
263 | + | |
264 | +static inline void dpm_runtime_resume(struct device * dev) | |
265 | +{ | |
266 | + | |
267 | +} | |
255 | 268 | |
256 | 269 | #endif |
257 | 270 |