Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=718efa64e30a5e9db0351d70c5a91969306a12d1
Commit:     718efa64e30a5e9db0351d70c5a91969306a12d1
Parent:     64e35d92367d8cd376946eb924838de1dd3287c7
Author:     Alan Stern <[EMAIL PROTECTED]>
AuthorDate: Fri Mar 9 15:41:13 2007 -0500
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 13:28:34 2007 -0700

    usbcore: move usb_autosuspend_work
    
    This patch (as864) moves the work routine for USB autosuspend from one
    source file to another.  This permits the removal of one whole global
    symbol (!) and should smooth the way for more changes in the future.
    
    Signed-off-by: Alan Stern <[EMAIL PROTECTED]>
    Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/core/driver.c |   21 +++++++++++++++++++--
 drivers/usb/core/usb.c    |   21 ---------------------
 drivers/usb/core/usb.h    |    8 +-------
 3 files changed, 20 insertions(+), 30 deletions(-)

diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c
index e6dd2b9..8c0a7de 100644
--- a/drivers/usb/core/driver.c
+++ b/drivers/usb/core/driver.c
@@ -1033,7 +1033,7 @@ static int autosuspend_check(struct usb_device *udev)
  *
  * This routine can run only in process context.
  */
-int usb_suspend_both(struct usb_device *udev, pm_message_t msg)
+static int usb_suspend_both(struct usb_device *udev, pm_message_t msg)
 {
        int                     status = 0;
        int                     i = 0;
@@ -1109,7 +1109,7 @@ int usb_suspend_both(struct usb_device *udev, 
pm_message_t msg)
  *
  * This routine can run only in process context.
  */
-int usb_resume_both(struct usb_device *udev)
+static int usb_resume_both(struct usb_device *udev)
 {
        int                     status = 0;
        int                     i;
@@ -1173,6 +1173,18 @@ int usb_resume_both(struct usb_device *udev)
 
 #ifdef CONFIG_USB_SUSPEND
 
+/* usb_autosuspend_work - callback routine to autosuspend a USB device */
+void usb_autosuspend_work(struct work_struct *work)
+{
+       struct usb_device *udev =
+               container_of(work, struct usb_device, autosuspend.work);
+
+       usb_pm_lock(udev);
+       udev->auto_pm = 1;
+       usb_suspend_both(udev, PMSG_SUSPEND);
+       usb_pm_unlock(udev);
+}
+
 /* Internal routine to adjust a device's usage counter and change
  * its autosuspend state.
  */
@@ -1405,6 +1417,11 @@ int usb_autopm_set_interface(struct usb_interface *intf)
 }
 EXPORT_SYMBOL_GPL(usb_autopm_set_interface);
 
+#else
+
+void usb_autosuspend_work(struct work_struct *work)
+{}
+
 #endif /* CONFIG_USB_SUSPEND */
 
 static int usb_suspend(struct device *dev, pm_message_t message)
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
index 54b42ce..82338f4 100644
--- a/drivers/usb/core/usb.c
+++ b/drivers/usb/core/usb.c
@@ -211,27 +211,6 @@ static void ksuspend_usb_cleanup(void)
        destroy_workqueue(ksuspend_usb_wq);
 }
 
-#ifdef CONFIG_USB_SUSPEND
-
-/* usb_autosuspend_work - callback routine to autosuspend a USB device */
-static void usb_autosuspend_work(struct work_struct *work)
-{
-       struct usb_device *udev =
-               container_of(work, struct usb_device, autosuspend.work);
-
-       usb_pm_lock(udev);
-       udev->auto_pm = 1;
-       usb_suspend_both(udev, PMSG_SUSPEND);
-       usb_pm_unlock(udev);
-}
-
-#else
-
-static void usb_autosuspend_work(struct work_struct *work)
-{}
-
-#endif /* CONFIG_USB_SUSPEND */
-
 #else
 
 #define ksuspend_usb_init()    0
diff --git a/drivers/usb/core/usb.h b/drivers/usb/core/usb.h
index 08b5a04..b98bc0d 100644
--- a/drivers/usb/core/usb.h
+++ b/drivers/usb/core/usb.h
@@ -34,8 +34,7 @@ extern void usb_host_cleanup(void);
 
 #ifdef CONFIG_PM
 
-extern int usb_suspend_both(struct usb_device *udev, pm_message_t msg);
-extern int usb_resume_both(struct usb_device *udev);
+extern void usb_autosuspend_work(struct work_struct *work);
 extern int usb_port_suspend(struct usb_device *dev);
 extern int usb_port_resume(struct usb_device *dev);
 
@@ -51,11 +50,6 @@ static inline void usb_pm_unlock(struct usb_device *udev)
 
 #else
 
-#define usb_suspend_both(udev, msg)    0
-static inline int usb_resume_both(struct usb_device *udev)
-{
-       return 0;
-}
 #define usb_port_suspend(dev)          0
 #define usb_port_resume(dev)           0
 static inline void usb_pm_lock(struct usb_device *udev) {}
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to