aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/dummy_hcd.c
diff options
context:
space:
mode:
authorRussell King <rmk@arm.linux.org.uk>2005-10-28 12:52:56 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2005-10-28 12:52:56 -0400
commit9480e307cd88ef09ec9294c7d97ebec18e6d2221 (patch)
tree967e26d3a23c24dd52b114d672312c207714308c /drivers/usb/gadget/dummy_hcd.c
parenta3a3395e487abc4c1371fe319a8ecbb3913a70a4 (diff)
[PATCH] DRIVER MODEL: Get rid of the obsolete tri-level suspend/resume callbacks
In PM v1, all devices were called at SUSPEND_DISABLE level. Then all devices were called at SUSPEND_SAVE_STATE level, and finally SUSPEND_POWER_DOWN level. However, with PM v2, to maintain compatibility for platform devices, I arranged for the PM v2 suspend/resume callbacks to call the old PM v1 suspend/resume callbacks three times with each level in order so that existing drivers continued to work. Since this is obsolete infrastructure which is no longer necessary, we can remove it. Here's an (untested) patch to do exactly that. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/gadget/dummy_hcd.c')
-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 583db7c38cf1..f2bdf4e1eb80 100644
--- a/drivers/usb/gadget/dummy_hcd.c
+++ b/drivers/usb/gadget/dummy_hcd.c
@@ -935,14 +935,10 @@ static int dummy_udc_remove (struct device *dev)
935 return 0; 935 return 0;
936} 936}
937 937
938static int dummy_udc_suspend (struct device *dev, pm_message_t state, 938static int dummy_udc_suspend (struct device *dev, pm_message_t state)
939 u32 level)
940{ 939{
941 struct dummy *dum = dev_get_drvdata(dev); 940 struct dummy *dum = dev_get_drvdata(dev);
942 941
943 if (level != SUSPEND_DISABLE)
944 return 0;
945
946 dev_dbg (dev, "%s\n", __FUNCTION__); 942 dev_dbg (dev, "%s\n", __FUNCTION__);
947 spin_lock_irq (&dum->lock); 943 spin_lock_irq (&dum->lock);
948 dum->udc_suspended = 1; 944 dum->udc_suspended = 1;
@@ -954,13 +950,10 @@ static int dummy_udc_suspend (struct device *dev, pm_message_t state,
954 return 0; 950 return 0;
955} 951}
956 952
957static int dummy_udc_resume (struct device *dev, u32 level) 953static int dummy_udc_resume (struct device *dev)
958{ 954{
959 struct dummy *dum = dev_get_drvdata(dev); 955 struct dummy *dum = dev_get_drvdata(dev);
960 956
961 if (level != RESUME_ENABLE)
962 return 0;
963
964 dev_dbg (dev, "%s\n", __FUNCTION__); 957 dev_dbg (dev, "%s\n", __FUNCTION__);
965 spin_lock_irq (&dum->lock); 958 spin_lock_irq (&dum->lock);
966 dum->udc_suspended = 0; 959 dum->udc_suspended = 0;
@@ -1936,14 +1929,10 @@ static int dummy_hcd_remove (struct device *dev)
1936 return 0; 1929 return 0;
1937} 1930}
1938 1931
1939static int dummy_hcd_suspend (struct device *dev, pm_message_t state, 1932static int dummy_hcd_suspend (struct device *dev, pm_message_t state)
1940 u32 level)
1941{ 1933{
1942 struct usb_hcd *hcd; 1934 struct usb_hcd *hcd;
1943 1935
1944 if (level != SUSPEND_DISABLE)
1945 return 0;
1946
1947 dev_dbg (dev, "%s\n", __FUNCTION__); 1936 dev_dbg (dev, "%s\n", __FUNCTION__);
1948 hcd = dev_get_drvdata (dev); 1937 hcd = dev_get_drvdata (dev);
1949 1938
@@ -1958,13 +1947,10 @@ static int dummy_hcd_suspend (struct device *dev, pm_message_t state,
1958 return 0; 1947 return 0;
1959} 1948}
1960 1949
1961static int dummy_hcd_resume (struct device *dev, u32 level) 1950static int dummy_hcd_resume (struct device *dev)
1962{ 1951{
1963 struct usb_hcd *hcd; 1952 struct usb_hcd *hcd;
1964 1953
1965 if (level != RESUME_ENABLE)
1966 return 0;
1967
1968 dev_dbg (dev, "%s\n", __FUNCTION__); 1954 dev_dbg (dev, "%s\n", __FUNCTION__);
1969 hcd = dev_get_drvdata (dev); 1955 hcd = dev_get_drvdata (dev);
1970 hcd->state = HC_STATE_RUNNING; 1956 hcd->state = HC_STATE_RUNNING;