aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2008-03-06 17:00:58 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2008-04-25 00:16:41 -0400
commit70a1c9e086c2e267fbc4533cb870f34999b531d6 (patch)
treef599883bdc2f04d4ca4760dfdb1f1131fa6b7060 /drivers/usb/host
parente1879b19b0abdb387e4aeb0b935a486cc75042fb (diff)
USB: remove dev->power.power_state
power.power_state is scheduled for removal. This patch (as1053) removes all uses of that field from drivers/usb. Almost all of them were write-only, the most significant exceptions being sl811-hcd.c and u132-hcd.c. Part of this patch was written by Pavel Machek. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Cc: David Brownell <david-b@pacbell.net> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host')
-rw-r--r--drivers/usb/host/ehci-dbg.c2
-rw-r--r--drivers/usb/host/ehci-ps3.c1
-rw-r--r--drivers/usb/host/isp116x-hcd.c12
-rw-r--r--drivers/usb/host/ohci-dbg.c2
-rw-r--r--drivers/usb/host/ohci-ep93xx.c2
-rw-r--r--drivers/usb/host/ohci-omap.c2
-rw-r--r--drivers/usb/host/ohci-ps3.c1
-rw-r--r--drivers/usb/host/ohci-pxa27x.c2
-rw-r--r--drivers/usb/host/ohci-sm501.c2
-rw-r--r--drivers/usb/host/r8a66597-hcd.c2
-rw-r--r--drivers/usb/host/sl811-hcd.c8
-rw-r--r--drivers/usb/host/u132-hcd.c7
12 files changed, 5 insertions, 38 deletions
diff --git a/drivers/usb/host/ehci-dbg.c b/drivers/usb/host/ehci-dbg.c
index 38eb92e5dc42..4af90df8e7de 100644
--- a/drivers/usb/host/ehci-dbg.c
+++ b/drivers/usb/host/ehci-dbg.c
@@ -670,7 +670,7 @@ static ssize_t fill_registers_buffer(struct debug_buffer *buf)
670 670
671 spin_lock_irqsave (&ehci->lock, flags); 671 spin_lock_irqsave (&ehci->lock, flags);
672 672
673 if (buf->bus->controller->power.power_state.event) { 673 if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags)) {
674 size = scnprintf (next, size, 674 size = scnprintf (next, size,
675 "bus %s, device %s (driver " DRIVER_VERSION ")\n" 675 "bus %s, device %s (driver " DRIVER_VERSION ")\n"
676 "%s\n" 676 "%s\n"
diff --git a/drivers/usb/host/ehci-ps3.c b/drivers/usb/host/ehci-ps3.c
index bbda58eb8813..69782221bcf3 100644
--- a/drivers/usb/host/ehci-ps3.c
+++ b/drivers/usb/host/ehci-ps3.c
@@ -125,7 +125,6 @@ static int ps3_ehci_probe(struct ps3_system_bus_device *dev)
125 goto fail_irq; 125 goto fail_irq;
126 } 126 }
127 127
128 dev->core.power.power_state = PMSG_ON;
129 dev->core.dma_mask = &dummy_mask; /* FIXME: for improper usb code */ 128 dev->core.dma_mask = &dummy_mask; /* FIXME: for improper usb code */
130 129
131 hcd = usb_create_hcd(&ps3_ehci_hc_driver, &dev->core, dev->core.bus_id); 130 hcd = usb_create_hcd(&ps3_ehci_hc_driver, &dev->core, dev->core.bus_id);
diff --git a/drivers/usb/host/isp116x-hcd.c b/drivers/usb/host/isp116x-hcd.c
index 203a3359a648..66d773c726f6 100644
--- a/drivers/usb/host/isp116x-hcd.c
+++ b/drivers/usb/host/isp116x-hcd.c
@@ -1442,11 +1442,6 @@ static int isp116x_bus_resume(struct usb_hcd *hcd)
1442 break; 1442 break;
1443 case HCCONTROL_USB_OPER: 1443 case HCCONTROL_USB_OPER:
1444 spin_unlock_irq(&isp116x->lock); 1444 spin_unlock_irq(&isp116x->lock);
1445 /* Without setting power_state here the
1446 SUSPENDED state won't be removed from
1447 sysfs/usbN/power.state as a response to remote
1448 wakeup. Maybe in the future. */
1449 hcd->self.root_hub->dev.power.power_state = PMSG_ON;
1450 return 0; 1445 return 0;
1451 default: 1446 default:
1452 /* HCCONTROL_USB_RESET: this may happen, when during 1447 /* HCCONTROL_USB_RESET: this may happen, when during
@@ -1460,7 +1455,6 @@ static int isp116x_bus_resume(struct usb_hcd *hcd)
1460 if ((isp116x->rhdesca & RH_A_NDP) == 2) 1455 if ((isp116x->rhdesca & RH_A_NDP) == 2)
1461 isp116x_hub_control(hcd, SetPortFeature, 1456 isp116x_hub_control(hcd, SetPortFeature,
1462 USB_PORT_FEAT_POWER, 2, NULL, 0); 1457 USB_PORT_FEAT_POWER, 2, NULL, 0);
1463 hcd->self.root_hub->dev.power.power_state = PMSG_ON;
1464 return 0; 1458 return 0;
1465 } 1459 }
1466 1460
@@ -1486,8 +1480,6 @@ static int isp116x_bus_resume(struct usb_hcd *hcd)
1486 isp116x_write_reg32(isp116x, HCCONTROL, 1480 isp116x_write_reg32(isp116x, HCCONTROL,
1487 (val & ~HCCONTROL_HCFS) | HCCONTROL_USB_OPER); 1481 (val & ~HCCONTROL_HCFS) | HCCONTROL_USB_OPER);
1488 spin_unlock_irq(&isp116x->lock); 1482 spin_unlock_irq(&isp116x->lock);
1489 /* see analogous comment above */
1490 hcd->self.root_hub->dev.power.power_state = PMSG_ON;
1491 hcd->state = HC_STATE_RUNNING; 1483 hcd->state = HC_STATE_RUNNING;
1492 1484
1493 return 0; 1485 return 0;
@@ -1663,7 +1655,6 @@ static int __devinit isp116x_probe(struct platform_device *pdev)
1663static int isp116x_suspend(struct platform_device *dev, pm_message_t state) 1655static int isp116x_suspend(struct platform_device *dev, pm_message_t state)
1664{ 1656{
1665 VDBG("%s: state %x\n", __func__, state.event); 1657 VDBG("%s: state %x\n", __func__, state.event);
1666 dev->dev.power.power_state = state;
1667 return 0; 1658 return 0;
1668} 1659}
1669 1660
@@ -1672,8 +1663,7 @@ static int isp116x_suspend(struct platform_device *dev, pm_message_t state)
1672*/ 1663*/
1673static int isp116x_resume(struct platform_device *dev) 1664static int isp116x_resume(struct platform_device *dev)
1674{ 1665{
1675 VDBG("%s: state %x\n", __func__, dev->power.power_state.event); 1666 VDBG("%s\n", __func__);
1676 dev->dev.power.power_state = PMSG_ON;
1677 return 0; 1667 return 0;
1678} 1668}
1679 1669
diff --git a/drivers/usb/host/ohci-dbg.c b/drivers/usb/host/ohci-dbg.c
index a22c30aa745d..e06bfaebec54 100644
--- a/drivers/usb/host/ohci-dbg.c
+++ b/drivers/usb/host/ohci-dbg.c
@@ -655,7 +655,7 @@ static ssize_t fill_registers_buffer(struct debug_buffer *buf)
655 hcd->product_desc, 655 hcd->product_desc,
656 hcd_name); 656 hcd_name);
657 657
658 if (bus->controller->power.power_state.event) { 658 if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags)) {
659 size -= scnprintf (next, size, 659 size -= scnprintf (next, size,
660 "SUSPENDED (no register access)\n"); 660 "SUSPENDED (no register access)\n");
661 goto done; 661 goto done;
diff --git a/drivers/usb/host/ohci-ep93xx.c b/drivers/usb/host/ohci-ep93xx.c
index 156e93a9d0df..40c683f8987d 100644
--- a/drivers/usb/host/ohci-ep93xx.c
+++ b/drivers/usb/host/ohci-ep93xx.c
@@ -177,7 +177,6 @@ static int ohci_hcd_ep93xx_drv_suspend(struct platform_device *pdev, pm_message_
177 177
178 ep93xx_stop_hc(&pdev->dev); 178 ep93xx_stop_hc(&pdev->dev);
179 hcd->state = HC_STATE_SUSPENDED; 179 hcd->state = HC_STATE_SUSPENDED;
180 pdev->dev.power.power_state = PMSG_SUSPEND;
181 180
182 return 0; 181 return 0;
183} 182}
@@ -193,7 +192,6 @@ static int ohci_hcd_ep93xx_drv_resume(struct platform_device *pdev)
193 ohci->next_statechange = jiffies; 192 ohci->next_statechange = jiffies;
194 193
195 ep93xx_start_hc(&pdev->dev); 194 ep93xx_start_hc(&pdev->dev);
196 pdev->dev.power.power_state = PMSG_ON;
197 usb_hcd_resume_root_hub(hcd); 195 usb_hcd_resume_root_hub(hcd);
198 196
199 return 0; 197 return 0;
diff --git a/drivers/usb/host/ohci-omap.c b/drivers/usb/host/ohci-omap.c
index 7bfca1ed1b58..2aafa7b6c81f 100644
--- a/drivers/usb/host/ohci-omap.c
+++ b/drivers/usb/host/ohci-omap.c
@@ -505,7 +505,6 @@ static int ohci_omap_suspend(struct platform_device *dev, pm_message_t message)
505 505
506 omap_ohci_clock_power(0); 506 omap_ohci_clock_power(0);
507 ohci_to_hcd(ohci)->state = HC_STATE_SUSPENDED; 507 ohci_to_hcd(ohci)->state = HC_STATE_SUSPENDED;
508 dev->dev.power.power_state = PMSG_SUSPEND;
509 return 0; 508 return 0;
510} 509}
511 510
@@ -518,7 +517,6 @@ static int ohci_omap_resume(struct platform_device *dev)
518 ohci->next_statechange = jiffies; 517 ohci->next_statechange = jiffies;
519 518
520 omap_ohci_clock_power(1); 519 omap_ohci_clock_power(1);
521 dev->dev.power.power_state = PMSG_ON;
522 usb_hcd_resume_root_hub(platform_get_drvdata(dev)); 520 usb_hcd_resume_root_hub(platform_get_drvdata(dev));
523 return 0; 521 return 0;
524} 522}
diff --git a/drivers/usb/host/ohci-ps3.c b/drivers/usb/host/ohci-ps3.c
index 01a0caeaa6bc..c1935ae537f8 100644
--- a/drivers/usb/host/ohci-ps3.c
+++ b/drivers/usb/host/ohci-ps3.c
@@ -127,7 +127,6 @@ static int ps3_ohci_probe(struct ps3_system_bus_device *dev)
127 goto fail_irq; 127 goto fail_irq;
128 } 128 }
129 129
130 dev->core.power.power_state = PMSG_ON;
131 dev->core.dma_mask = &dummy_mask; /* FIXME: for improper usb code */ 130 dev->core.dma_mask = &dummy_mask; /* FIXME: for improper usb code */
132 131
133 hcd = usb_create_hcd(&ps3_ohci_hc_driver, &dev->core, dev->core.bus_id); 132 hcd = usb_create_hcd(&ps3_ohci_hc_driver, &dev->core, dev->core.bus_id);
diff --git a/drivers/usb/host/ohci-pxa27x.c b/drivers/usb/host/ohci-pxa27x.c
index 8ad9b3b604b5..5d470263eed8 100644
--- a/drivers/usb/host/ohci-pxa27x.c
+++ b/drivers/usb/host/ohci-pxa27x.c
@@ -339,7 +339,6 @@ static int ohci_hcd_pxa27x_drv_suspend(struct platform_device *pdev, pm_message_
339 339
340 pxa27x_stop_hc(&pdev->dev); 340 pxa27x_stop_hc(&pdev->dev);
341 hcd->state = HC_STATE_SUSPENDED; 341 hcd->state = HC_STATE_SUSPENDED;
342 pdev->dev.power.power_state = PMSG_SUSPEND;
343 342
344 return 0; 343 return 0;
345} 344}
@@ -357,7 +356,6 @@ static int ohci_hcd_pxa27x_drv_resume(struct platform_device *pdev)
357 if ((status = pxa27x_start_hc(&pdev->dev)) < 0) 356 if ((status = pxa27x_start_hc(&pdev->dev)) < 0)
358 return status; 357 return status;
359 358
360 pdev->dev.power.power_state = PMSG_ON;
361 usb_hcd_resume_root_hub(hcd); 359 usb_hcd_resume_root_hub(hcd);
362 360
363 return 0; 361 return 0;
diff --git a/drivers/usb/host/ohci-sm501.c b/drivers/usb/host/ohci-sm501.c
index 8ffcd3e5f56b..ab1e366d7790 100644
--- a/drivers/usb/host/ohci-sm501.c
+++ b/drivers/usb/host/ohci-sm501.c
@@ -224,7 +224,6 @@ static int ohci_sm501_suspend(struct platform_device *pdev, pm_message_t msg)
224 224
225 sm501_unit_power(dev->parent, SM501_GATE_USB_HOST, 0); 225 sm501_unit_power(dev->parent, SM501_GATE_USB_HOST, 0);
226 ohci_to_hcd(ohci)->state = HC_STATE_SUSPENDED; 226 ohci_to_hcd(ohci)->state = HC_STATE_SUSPENDED;
227 dev->power.power_state = PMSG_SUSPEND;
228 return 0; 227 return 0;
229} 228}
230 229
@@ -238,7 +237,6 @@ static int ohci_sm501_resume(struct platform_device *pdev)
238 ohci->next_statechange = jiffies; 237 ohci->next_statechange = jiffies;
239 238
240 sm501_unit_power(dev->parent, SM501_GATE_USB_HOST, 1); 239 sm501_unit_power(dev->parent, SM501_GATE_USB_HOST, 1);
241 dev->power.power_state = PMSG_ON;
242 usb_hcd_resume_root_hub(platform_get_drvdata(pdev)); 240 usb_hcd_resume_root_hub(platform_get_drvdata(pdev));
243 return 0; 241 return 0;
244} 242}
diff --git a/drivers/usb/host/r8a66597-hcd.c b/drivers/usb/host/r8a66597-hcd.c
index afd4fbe7713c..b46ff9a80b66 100644
--- a/drivers/usb/host/r8a66597-hcd.c
+++ b/drivers/usb/host/r8a66597-hcd.c
@@ -2107,13 +2107,11 @@ static struct hc_driver r8a66597_hc_driver = {
2107#if defined(CONFIG_PM) 2107#if defined(CONFIG_PM)
2108static int r8a66597_suspend(struct platform_device *pdev, pm_message_t state) 2108static int r8a66597_suspend(struct platform_device *pdev, pm_message_t state)
2109{ 2109{
2110 pdev->dev.power.power_state = state;
2111 return 0; 2110 return 0;
2112} 2111}
2113 2112
2114static int r8a66597_resume(struct platform_device *pdev) 2113static int r8a66597_resume(struct platform_device *pdev)
2115{ 2114{
2116 pdev->dev.power.power_state = PMSG_ON;
2117 return 0; 2115 return 0;
2118} 2116}
2119#else /* if defined(CONFIG_PM) */ 2117#else /* if defined(CONFIG_PM) */
diff --git a/drivers/usb/host/sl811-hcd.c b/drivers/usb/host/sl811-hcd.c
index 629bca0ebe8f..df256d61e2c6 100644
--- a/drivers/usb/host/sl811-hcd.c
+++ b/drivers/usb/host/sl811-hcd.c
@@ -94,12 +94,10 @@ static void port_power(struct sl811 *sl811, int is_on)
94 94
95 sl811->port1 = (1 << USB_PORT_FEAT_POWER); 95 sl811->port1 = (1 << USB_PORT_FEAT_POWER);
96 sl811->irq_enable = SL11H_INTMASK_INSRMV; 96 sl811->irq_enable = SL11H_INTMASK_INSRMV;
97 hcd->self.controller->power.power_state = PMSG_ON;
98 } else { 97 } else {
99 sl811->port1 = 0; 98 sl811->port1 = 0;
100 sl811->irq_enable = 0; 99 sl811->irq_enable = 0;
101 hcd->state = HC_STATE_HALT; 100 hcd->state = HC_STATE_HALT;
102 hcd->self.controller->power.power_state = PMSG_SUSPEND;
103 } 101 }
104 sl811->ctrl1 = 0; 102 sl811->ctrl1 = 0;
105 sl811_write(sl811, SL11H_IRQ_ENABLE, 0); 103 sl811_write(sl811, SL11H_IRQ_ENABLE, 0);
@@ -1772,8 +1770,6 @@ sl811h_suspend(struct platform_device *dev, pm_message_t state)
1772 port_power(sl811, 0); 1770 port_power(sl811, 0);
1773 break; 1771 break;
1774 } 1772 }
1775 if (retval == 0)
1776 dev->dev.power.power_state = state;
1777 return retval; 1773 return retval;
1778} 1774}
1779 1775
@@ -1786,15 +1782,13 @@ sl811h_resume(struct platform_device *dev)
1786 /* with no "check to see if VBUS is still powered" board hook, 1782 /* with no "check to see if VBUS is still powered" board hook,
1787 * let's assume it'd only be powered to enable remote wakeup. 1783 * let's assume it'd only be powered to enable remote wakeup.
1788 */ 1784 */
1789 if (dev->dev.power.power_state.event == PM_EVENT_SUSPEND 1785 if (!sl811->port1 || !device_can_wakeup(&hcd->self.root_hub->dev)) {
1790 || !device_can_wakeup(&hcd->self.root_hub->dev)) {
1791 sl811->port1 = 0; 1786 sl811->port1 = 0;
1792 port_power(sl811, 1); 1787 port_power(sl811, 1);
1793 usb_root_hub_lost_power(hcd->self.root_hub); 1788 usb_root_hub_lost_power(hcd->self.root_hub);
1794 return 0; 1789 return 0;
1795 } 1790 }
1796 1791
1797 dev->dev.power.power_state = PMSG_ON;
1798 return sl811h_bus_resume(hcd); 1792 return sl811h_bus_resume(hcd);
1799} 1793}
1800 1794
diff --git a/drivers/usb/host/u132-hcd.c b/drivers/usb/host/u132-hcd.c
index 8e117a795e93..6e9b7edff528 100644
--- a/drivers/usb/host/u132-hcd.c
+++ b/drivers/usb/host/u132-hcd.c
@@ -1534,11 +1534,9 @@ static void u132_power(struct u132 *u132, int is_on)
1534 if (u132->power) 1534 if (u132->power)
1535 return; 1535 return;
1536 u132->power = 1; 1536 u132->power = 1;
1537 hcd->self.controller->power.power_state = PMSG_ON;
1538 } else { 1537 } else {
1539 u132->power = 0; 1538 u132->power = 0;
1540 hcd->state = HC_STATE_HALT; 1539 hcd->state = HC_STATE_HALT;
1541 hcd->self.controller->power.power_state = PMSG_SUSPEND;
1542 } 1540 }
1543} 1541}
1544 1542
@@ -3227,8 +3225,6 @@ static int u132_suspend(struct platform_device *pdev, pm_message_t state)
3227 } 3225 }
3228 break; 3226 break;
3229 } 3227 }
3230 if (retval == 0)
3231 pdev->dev.power.power_state = state;
3232 return retval; 3228 return retval;
3233 } 3229 }
3234} 3230}
@@ -3246,14 +3242,13 @@ static int u132_resume(struct platform_device *pdev)
3246 return -ESHUTDOWN; 3242 return -ESHUTDOWN;
3247 } else { 3243 } else {
3248 int retval = 0; 3244 int retval = 0;
3249 if (pdev->dev.power.power_state.event == PM_EVENT_SUSPEND) { 3245 if (!u132->port[0].power) {
3250 int ports = MAX_U132_PORTS; 3246 int ports = MAX_U132_PORTS;
3251 while (ports-- > 0) { 3247 while (ports-- > 0) {
3252 port_power(u132, ports, 1); 3248 port_power(u132, ports, 1);
3253 } 3249 }
3254 retval = 0; 3250 retval = 0;
3255 } else { 3251 } else {
3256 pdev->dev.power.power_state = PMSG_ON;
3257 retval = u132_bus_resume(hcd); 3252 retval = u132_bus_resume(hcd);
3258 } 3253 }
3259 return retval; 3254 return retval;