aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2005-10-13 17:08:02 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2005-10-28 19:47:44 -0400
commit0c0382e32d46f606951010b202382be14d180a17 (patch)
tree078327baa96637ca6d70bae3c59a16b0ff46f1f1 /drivers/usb/gadget
parentbb200f6eac6372839921be1fe87c1f5c292a7bd6 (diff)
[PATCH] USB: Rename hcd->hub_suspend to hcd->bus_suspend
This patch (as580) is perhaps the only result from the long discussion I had with David about his changes to the root-hub suspend/resume code. It renames the hub_suspend and hub_resume methods in struct usb_hcd to bus_suspend and bus_resume. These are more descriptive names, since the methods really do suspend or resume an entire USB bus, and less likely to be confused with the hub_suspend and hub_resume routines in hub.c. It also takes David's advice about removing the layer of bus glue, where those methods are called. And it implements a related change that David made to the other HCDs but forgot to put into dummy_hcd. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r--drivers/usb/gadget/dummy_hcd.c22
1 files changed, 4 insertions, 18 deletions
diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c
index 503201764f6b..c605aaeed636 100644
--- a/drivers/usb/gadget/dummy_hcd.c
+++ b/drivers/usb/gadget/dummy_hcd.c
@@ -1751,7 +1751,7 @@ static int dummy_hub_control (
1751 return retval; 1751 return retval;
1752} 1752}
1753 1753
1754static int dummy_hub_suspend (struct usb_hcd *hcd) 1754static int dummy_bus_suspend (struct usb_hcd *hcd)
1755{ 1755{
1756 struct dummy *dum = hcd_to_dummy (hcd); 1756 struct dummy *dum = hcd_to_dummy (hcd);
1757 1757
@@ -1762,7 +1762,7 @@ static int dummy_hub_suspend (struct usb_hcd *hcd)
1762 return 0; 1762 return 0;
1763} 1763}
1764 1764
1765static int dummy_hub_resume (struct usb_hcd *hcd) 1765static int dummy_bus_resume (struct usb_hcd *hcd)
1766{ 1766{
1767 struct dummy *dum = hcd_to_dummy (hcd); 1767 struct dummy *dum = hcd_to_dummy (hcd);
1768 1768
@@ -1894,8 +1894,8 @@ static const struct hc_driver dummy_hcd = {
1894 1894
1895 .hub_status_data = dummy_hub_status, 1895 .hub_status_data = dummy_hub_status,
1896 .hub_control = dummy_hub_control, 1896 .hub_control = dummy_hub_control,
1897 .hub_suspend = dummy_hub_suspend, 1897 .bus_suspend = dummy_bus_suspend,
1898 .hub_resume = dummy_hub_resume, 1898 .bus_resume = dummy_bus_resume,
1899}; 1899};
1900 1900
1901static int dummy_hcd_probe (struct device *dev) 1901static int dummy_hcd_probe (struct device *dev)
@@ -1936,13 +1936,6 @@ static int dummy_hcd_suspend (struct device *dev, pm_message_t state)
1936 dev_dbg (dev, "%s\n", __FUNCTION__); 1936 dev_dbg (dev, "%s\n", __FUNCTION__);
1937 hcd = dev_get_drvdata (dev); 1937 hcd = dev_get_drvdata (dev);
1938 1938
1939#ifndef CONFIG_USB_SUSPEND
1940 /* Otherwise this would never happen */
1941 usb_lock_device (hcd->self.root_hub);
1942 dummy_hub_suspend (hcd);
1943 usb_unlock_device (hcd->self.root_hub);
1944#endif
1945
1946 hcd->state = HC_STATE_SUSPENDED; 1939 hcd->state = HC_STATE_SUSPENDED;
1947 return 0; 1940 return 0;
1948} 1941}
@@ -1955,13 +1948,6 @@ static int dummy_hcd_resume (struct device *dev)
1955 hcd = dev_get_drvdata (dev); 1948 hcd = dev_get_drvdata (dev);
1956 hcd->state = HC_STATE_RUNNING; 1949 hcd->state = HC_STATE_RUNNING;
1957 1950
1958#ifndef CONFIG_USB_SUSPEND
1959 /* Otherwise this would never happen */
1960 usb_lock_device (hcd->self.root_hub);
1961 dummy_hub_resume (hcd);
1962 usb_unlock_device (hcd->self.root_hub);
1963#endif
1964
1965 usb_hcd_poll_rh_status (hcd); 1951 usb_hcd_poll_rh_status (hcd);
1966 return 0; 1952 return 0;
1967} 1953}