Skip to content

Commit

Permalink
[PATCH] USB ATM: robustify poll throttling
Browse files Browse the repository at this point in the history
No functional change, but less likely to break in the future.

Signed-off-by: Duncan Sands <baldrick@free.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Duncan Sands authored and Greg Kroah-Hartman committed Jul 12, 2005
1 parent 322a95b commit cd5c08f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/usb/atm/speedtch.c
Original file line number Diff line number Diff line change
Expand Up @@ -430,13 +430,11 @@ static void speedtch_check_status(struct speedtch_instance_data *instance)
ret = speedtch_read_status(instance);
if (ret < 0) {
atm_warn(usbatm, "error %d fetching device status\n", ret);
if (instance->poll_delay < MAX_POLL_DELAY)
instance->poll_delay *= 2;
instance->poll_delay = min(2 * instance->poll_delay, MAX_POLL_DELAY);
return;
}

if (instance->poll_delay > MIN_POLL_DELAY)
instance->poll_delay /= 2;
instance->poll_delay = max(instance->poll_delay / 2, MIN_POLL_DELAY);

atm_dbg(usbatm, "%s: line state %02x\n", __func__, buf[OFFSET_7]);

Expand Down

0 comments on commit cd5c08f

Please sign in to comment.