Commit 42842f8a authored by Oliver Neukum's avatar Oliver Neukum Committed by Greg Kroah-Hartman

[PATCH] USB: purge wait_ms from core

this makes the core use the new safe waiting helper.

  - remove wait_ms from hub driver
parent 289cf6ad
...@@ -381,7 +381,7 @@ static void hub_power_on(struct usb_hub *hub) ...@@ -381,7 +381,7 @@ static void hub_power_on(struct usb_hub *hub)
} }
/* Wait for power to be enabled */ /* Wait for power to be enabled */
wait_ms(hub->descriptor->bPwrOn2PwrGood * 2); usb_uninterruptible_sleep_ms(hub->descriptor->bPwrOn2PwrGood * 2);
} }
static int hub_hub_status(struct usb_hub *hub, static int hub_hub_status(struct usb_hub *hub,
...@@ -887,7 +887,7 @@ static int hub_port_wait_reset(struct usb_device *hub, int port, ...@@ -887,7 +887,7 @@ static int hub_port_wait_reset(struct usb_device *hub, int port,
delay_time < HUB_RESET_TIMEOUT; delay_time < HUB_RESET_TIMEOUT;
delay_time += delay) { delay_time += delay) {
/* wait to give the device a chance to reset */ /* wait to give the device a chance to reset */
wait_ms(delay); usb_uninterruptible_sleep_ms(delay);
/* read and decode port status */ /* read and decode port status */
ret = hub_port_status(hub, port, &portstatus, &portchange); ret = hub_port_status(hub, port, &portstatus, &portchange);
...@@ -1002,7 +1002,7 @@ static int hub_port_debounce(struct usb_device *hub, int port) ...@@ -1002,7 +1002,7 @@ static int hub_port_debounce(struct usb_device *hub, int port)
connection = 0; connection = 0;
stable_count = 0; stable_count = 0;
for (delay_time = 0; delay_time < HUB_DEBOUNCE_TIMEOUT; delay_time += HUB_DEBOUNCE_STEP) { for (delay_time = 0; delay_time < HUB_DEBOUNCE_TIMEOUT; delay_time += HUB_DEBOUNCE_STEP) {
wait_ms(HUB_DEBOUNCE_STEP); usb_uninterruptible_sleep_ms(HUB_DEBOUNCE_STEP);
ret = hub_port_status(hub, port, &portstatus, &portchange); ret = hub_port_status(hub, port, &portstatus, &portchange);
if (ret < 0) if (ret < 0)
...@@ -1146,7 +1146,7 @@ hub_port_init (struct usb_device *hub, struct usb_device *dev, int port) ...@@ -1146,7 +1146,7 @@ hub_port_init (struct usb_device *hub, struct usb_device *dev, int port)
retval = usb_set_address(dev); retval = usb_set_address(dev);
if (retval >= 0) if (retval >= 0)
break; break;
wait_ms(200); usb_uninterruptible_sleep_ms(200);
} }
if (retval < 0) { if (retval < 0) {
dev_err(&dev->dev, dev_err(&dev->dev,
...@@ -1165,11 +1165,11 @@ hub_port_init (struct usb_device *hub, struct usb_device *dev, int port) ...@@ -1165,11 +1165,11 @@ hub_port_init (struct usb_device *hub, struct usb_device *dev, int port)
* - let SET_ADDRESS settle, some device hardware wants it * - let SET_ADDRESS settle, some device hardware wants it
* - read ep0 maxpacket even for high and low speed, * - read ep0 maxpacket even for high and low speed,
*/ */
wait_ms(10); usb_uninterruptible_sleep_ms(10);
retval = usb_get_device_descriptor(dev, 8); retval = usb_get_device_descriptor(dev, 8);
if (retval >= 8) if (retval >= 8)
break; break;
wait_ms(100); usb_uninterruptible_sleep_ms(100);
} }
if (retval != 8) { if (retval != 8) {
dev_err(&dev->dev, "device descriptor read/%s, error %d\n", dev_err(&dev->dev, "device descriptor read/%s, error %d\n",
...@@ -1515,7 +1515,7 @@ static void hub_events(void) ...@@ -1515,7 +1515,7 @@ static void hub_events(void)
} }
if (hubchange & HUB_CHANGE_OVERCURRENT) { if (hubchange & HUB_CHANGE_OVERCURRENT) {
dev_dbg (&hub->intf->dev, "overcurrent change\n"); dev_dbg (&hub->intf->dev, "overcurrent change\n");
wait_ms(500); /* Cool down */ usb_uninterruptible_sleep_ms(500); /* Cool down */
clear_hub_feature(dev, C_HUB_OVER_CURRENT); clear_hub_feature(dev, C_HUB_OVER_CURRENT);
hub_power_on(hub); hub_power_on(hub);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment