USB: EHCI: move ehci_update_device() to ehci-lpm.c
authorAlan Stern <stern@rowland.harvard.edu>
Wed, 10 Oct 2012 19:07:46 +0000 (15:07 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 Oct 2012 21:45:17 +0000 (14:45 -0700)
In preparation for splitting the ehci-hcd driver into a core library
and separate platform-specific driver modules, this patch (as1618)
moves ehci_update_device() from a couple of platform-specific source
files into ehci-lpm.c.  This is where it should have been all along,
since all it does is call a couple of other functions that are already
in ehci-lpm.c.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/ehci-lpm.c
drivers/usb/host/ehci-pci.c
drivers/usb/host/ehci-vt8500.c

index 2111627a19deefa935d4e724efe86965893dc168..6b092c1dff64c4e78035899304896296e82263e4 100644 (file)
@@ -17,8 +17,8 @@
 */
 
 /* this file is part of ehci-hcd.c */
-static int __maybe_unused ehci_lpm_set_da(struct ehci_hcd *ehci,
-       int dev_addr, int port_num)
+
+static int ehci_lpm_set_da(struct ehci_hcd *ehci, int dev_addr, int port_num)
 {
        u32 __iomem portsc;
 
@@ -38,7 +38,7 @@ static int __maybe_unused ehci_lpm_set_da(struct ehci_hcd *ehci,
  * this function is used to check if the device support LPM
  * if yes, mark the PORTSC register with PORT_LPM bit
  */
-static int __maybe_unused ehci_lpm_check(struct ehci_hcd *ehci, int port)
+static int ehci_lpm_check(struct ehci_hcd *ehci, int port)
 {
        u32 __iomem     *portsc ;
        u32 val32;
@@ -82,3 +82,20 @@ static int __maybe_unused ehci_lpm_check(struct ehci_hcd *ehci, int port)
 
        return retval;
 }
+
+static int __maybe_unused ehci_update_device(struct usb_hcd *hcd,
+               struct usb_device *udev)
+{
+       struct ehci_hcd *ehci = hcd_to_ehci(hcd);
+       int rc = 0;
+
+       if (!udev->parent) /* udev is root hub itself, impossible */
+               rc = -1;
+       /* we only support lpm device connected to root hub yet */
+       if (ehci->has_lpm && !udev->parent->parent) {
+               rc = ehci_lpm_set_da(ehci, udev->devnum, udev->portnum);
+               if (!rc)
+                       rc = ehci_lpm_check(ehci, udev->portnum);
+       }
+       return rc;
+}
index d1407f8d42b1046b0012bcf52d73bc5cbc6c704e..7880ba621f89552ee0d76fc4ae5b70a75d256d23 100644 (file)
@@ -379,22 +379,6 @@ static int ehci_pci_resume(struct usb_hcd *hcd, bool hibernated)
 }
 #endif
 
-static int ehci_update_device(struct usb_hcd *hcd, struct usb_device *udev)
-{
-       struct ehci_hcd *ehci = hcd_to_ehci(hcd);
-       int rc = 0;
-
-       if (!udev->parent) /* udev is root hub itself, impossible */
-               rc = -1;
-       /* we only support lpm device connected to root hub yet */
-       if (ehci->has_lpm && !udev->parent->parent) {
-               rc = ehci_lpm_set_da(ehci, udev->devnum, udev->portnum);
-               if (!rc)
-                       rc = ehci_lpm_check(ehci, udev->portnum);
-       }
-       return rc;
-}
-
 static const struct hc_driver ehci_pci_hc_driver = {
        .description =          hcd_name,
        .product_desc =         "EHCI Host Controller",
index d3c9a3e397b99ed4f423ee41575038890ff4e4eb..c6fe0bb619cb212499ba2b04b0c64c1f396d5da2 100644 (file)
 #include <linux/of.h>
 #include <linux/platform_device.h>
 
-static int ehci_update_device(struct usb_hcd *hcd, struct usb_device *udev)
-{
-       struct ehci_hcd *ehci = hcd_to_ehci(hcd);
-       int rc = 0;
-
-       if (!udev->parent) /* udev is root hub itself, impossible */
-               rc = -1;
-       /* we only support lpm device connected to root hub yet */
-       if (ehci->has_lpm && !udev->parent->parent) {
-               rc = ehci_lpm_set_da(ehci, udev->devnum, udev->portnum);
-               if (!rc)
-                       rc = ehci_lpm_check(ehci, udev->portnum);
-       }
-       return rc;
-}
-
 static const struct hc_driver vt8500_ehci_hc_driver = {
        .description            = hcd_name,
        .product_desc           = "VT8500 EHCI",