]> err.no Git - linux-2.6/commitdiff
[PATCH] USB: fix pm patches with CONFIG_PM off part 2
authorAndrew Morton <akpm@osdl.org>
Mon, 24 Oct 2005 06:02:20 +0000 (23:02 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 28 Oct 2005 23:47:52 +0000 (16:47 -0700)
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>
drivers/base/power/power.h
drivers/usb/core/hub.c
include/linux/pm.h

index 2e700d795cf15033c933e4a1a71a4d73afa59a14..fb3d35a9e101582563b357848617cd7539e65e3a 100644 (file)
@@ -67,9 +67,6 @@ extern int suspend_device(struct device *, pm_message_t);
  * 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(struct device * dev)
 
 }
 
-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
index 1bacb374b007a3c1e751bc7b94cc13508463e288..9660a8909b7ca9860f50776d41e992486f60df2d 100644 (file)
@@ -2652,8 +2652,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);
                }
index 83bae1cbe55b9a6857853c25af7a46766d40f2e6..c61d5de837efaf4fa38829ab417f1993ad70f5b6 100644 (file)
@@ -243,6 +243,9 @@ extern int device_suspend(pm_message_t state);
 #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)
@@ -253,6 +256,16 @@ static inline int device_suspend(pm_message_t state)
 #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.