diff options
| author | Olivier Sobrie <olivier@sobrie.be> | 2015-01-30 07:21:59 -0500 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2015-02-01 15:33:27 -0500 |
| commit | 26c1f1f544450d850971173725fe2f256ea2508b (patch) | |
| tree | 5e5123b3aea32088a981f0e19bf0b64eb6e918c5 /drivers/net/usb | |
| parent | f6516b697c8a1772c1b4ca0be30764e70c3143dd (diff) | |
hso: replace reset_device work by usb_queue_reset_device()
There is no need for a dedicated reset work in the hso driver since
there is already a reset work foreseen in usb_interface that does
the same.
Signed-off-by: Olivier Sobrie <olivier@sobrie.be>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/usb')
| -rw-r--r-- | drivers/net/usb/hso.c | 25 |
1 files changed, 1 insertions, 24 deletions
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c index fc310303bed8..1e85ae76539e 100644 --- a/drivers/net/usb/hso.c +++ b/drivers/net/usb/hso.c | |||
| @@ -274,7 +274,6 @@ struct hso_device { | |||
| 274 | u8 usb_gone; | 274 | u8 usb_gone; |
| 275 | struct work_struct async_get_intf; | 275 | struct work_struct async_get_intf; |
| 276 | struct work_struct async_put_intf; | 276 | struct work_struct async_put_intf; |
| 277 | struct work_struct reset_device; | ||
| 278 | 277 | ||
| 279 | struct usb_device *usb; | 278 | struct usb_device *usb; |
| 280 | struct usb_interface *interface; | 279 | struct usb_interface *interface; |
| @@ -340,7 +339,6 @@ static void async_put_intf(struct work_struct *data); | |||
| 340 | static int hso_put_activity(struct hso_device *hso_dev); | 339 | static int hso_put_activity(struct hso_device *hso_dev); |
| 341 | static int hso_get_activity(struct hso_device *hso_dev); | 340 | static int hso_get_activity(struct hso_device *hso_dev); |
| 342 | static void tiocmget_intr_callback(struct urb *urb); | 341 | static void tiocmget_intr_callback(struct urb *urb); |
| 343 | static void reset_device(struct work_struct *data); | ||
| 344 | /*****************************************************************************/ | 342 | /*****************************************************************************/ |
| 345 | /* Helping functions */ | 343 | /* Helping functions */ |
| 346 | /*****************************************************************************/ | 344 | /*****************************************************************************/ |
| @@ -696,7 +694,7 @@ static void handle_usb_error(int status, const char *function, | |||
| 696 | case -ETIMEDOUT: | 694 | case -ETIMEDOUT: |
| 697 | explanation = "protocol error"; | 695 | explanation = "protocol error"; |
| 698 | if (hso_dev) | 696 | if (hso_dev) |
| 699 | schedule_work(&hso_dev->reset_device); | 697 | usb_queue_reset_device(hso_dev->interface); |
| 700 | break; | 698 | break; |
| 701 | default: | 699 | default: |
| 702 | explanation = "unknown status"; | 700 | explanation = "unknown status"; |
| @@ -2347,7 +2345,6 @@ static struct hso_device *hso_create_device(struct usb_interface *intf, | |||
| 2347 | 2345 | ||
| 2348 | INIT_WORK(&hso_dev->async_get_intf, async_get_intf); | 2346 | INIT_WORK(&hso_dev->async_get_intf, async_get_intf); |
| 2349 | INIT_WORK(&hso_dev->async_put_intf, async_put_intf); | 2347 | INIT_WORK(&hso_dev->async_put_intf, async_put_intf); |
| 2350 | INIT_WORK(&hso_dev->reset_device, reset_device); | ||
| 2351 | 2348 | ||
| 2352 | return hso_dev; | 2349 | return hso_dev; |
| 2353 | } | 2350 | } |
| @@ -3085,26 +3082,6 @@ out: | |||
| 3085 | return result; | 3082 | return result; |
| 3086 | } | 3083 | } |
| 3087 | 3084 | ||
| 3088 | static void reset_device(struct work_struct *data) | ||
| 3089 | { | ||
| 3090 | struct hso_device *hso_dev = | ||
| 3091 | container_of(data, struct hso_device, reset_device); | ||
| 3092 | struct usb_device *usb = hso_dev->usb; | ||
| 3093 | int result; | ||
| 3094 | |||
| 3095 | if (hso_dev->usb_gone) { | ||
| 3096 | D1("No reset during disconnect\n"); | ||
| 3097 | } else { | ||
| 3098 | result = usb_lock_device_for_reset(usb, hso_dev->interface); | ||
| 3099 | if (result < 0) | ||
| 3100 | D1("unable to lock device for reset: %d\n", result); | ||
| 3101 | else { | ||
| 3102 | usb_reset_device(usb); | ||
| 3103 | usb_unlock_device(usb); | ||
| 3104 | } | ||
| 3105 | } | ||
| 3106 | } | ||
| 3107 | |||
| 3108 | static void hso_serial_ref_free(struct kref *ref) | 3085 | static void hso_serial_ref_free(struct kref *ref) |
| 3109 | { | 3086 | { |
| 3110 | struct hso_device *hso_dev = container_of(ref, struct hso_device, ref); | 3087 | struct hso_device *hso_dev = container_of(ref, struct hso_device, ref); |
