diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2006-08-30 11:27:36 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-09-27 14:58:56 -0400 |
commit | a6d2bb9ff919b4685bd684620ec7a1ffa8bf2349 (patch) | |
tree | 5bd0cc451d3ce84765c7ec6a60d486d0155b3356 /drivers/usb/core/urb.c | |
parent | 511366da534bad226e89d294c3b3e910a2aaba6b (diff) |
USB: remove struct usb_operations
All of the currently-supported USB host controller drivers use the HCD
bus-glue framework. As part of the program for flattening out the glue
layer, this patch (as769) removes the usb_operations structure. All
function calls now go directly to the HCD routines (slightly renamed
to remain within the "usb_" namespace).
The patch also removes usb_alloc_bus(), because it's not useful in the
HCD framework and it wasn't referenced anywhere.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/core/urb.c')
-rw-r--r-- | drivers/usb/core/urb.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/usb/core/urb.c b/drivers/usb/core/urb.c index 9864988377c..576919927f5 100644 --- a/drivers/usb/core/urb.c +++ b/drivers/usb/core/urb.c | |||
@@ -221,7 +221,6 @@ int usb_submit_urb(struct urb *urb, gfp_t mem_flags) | |||
221 | { | 221 | { |
222 | int pipe, temp, max; | 222 | int pipe, temp, max; |
223 | struct usb_device *dev; | 223 | struct usb_device *dev; |
224 | struct usb_operations *op; | ||
225 | int is_out; | 224 | int is_out; |
226 | 225 | ||
227 | if (!urb || urb->hcpriv || !urb->complete) | 226 | if (!urb || urb->hcpriv || !urb->complete) |
@@ -233,8 +232,6 @@ int usb_submit_urb(struct urb *urb, gfp_t mem_flags) | |||
233 | if (dev->bus->controller->power.power_state.event != PM_EVENT_ON | 232 | if (dev->bus->controller->power.power_state.event != PM_EVENT_ON |
234 | || dev->state == USB_STATE_SUSPENDED) | 233 | || dev->state == USB_STATE_SUSPENDED) |
235 | return -EHOSTUNREACH; | 234 | return -EHOSTUNREACH; |
236 | if (!(op = dev->bus->op) || !op->submit_urb) | ||
237 | return -ENODEV; | ||
238 | 235 | ||
239 | urb->status = -EINPROGRESS; | 236 | urb->status = -EINPROGRESS; |
240 | urb->actual_length = 0; | 237 | urb->actual_length = 0; |
@@ -376,7 +373,7 @@ int usb_submit_urb(struct urb *urb, gfp_t mem_flags) | |||
376 | urb->interval = temp; | 373 | urb->interval = temp; |
377 | } | 374 | } |
378 | 375 | ||
379 | return op->submit_urb (urb, mem_flags); | 376 | return usb_hcd_submit_urb (urb, mem_flags); |
380 | } | 377 | } |
381 | 378 | ||
382 | /*-------------------------------------------------------------------*/ | 379 | /*-------------------------------------------------------------------*/ |
@@ -440,9 +437,9 @@ int usb_unlink_urb(struct urb *urb) | |||
440 | { | 437 | { |
441 | if (!urb) | 438 | if (!urb) |
442 | return -EINVAL; | 439 | return -EINVAL; |
443 | if (!(urb->dev && urb->dev->bus && urb->dev->bus->op)) | 440 | if (!(urb->dev && urb->dev->bus)) |
444 | return -ENODEV; | 441 | return -ENODEV; |
445 | return urb->dev->bus->op->unlink_urb(urb, -ECONNRESET); | 442 | return usb_hcd_unlink_urb(urb, -ECONNRESET); |
446 | } | 443 | } |
447 | 444 | ||
448 | /** | 445 | /** |
@@ -468,13 +465,13 @@ int usb_unlink_urb(struct urb *urb) | |||
468 | void usb_kill_urb(struct urb *urb) | 465 | void usb_kill_urb(struct urb *urb) |
469 | { | 466 | { |
470 | might_sleep(); | 467 | might_sleep(); |
471 | if (!(urb && urb->dev && urb->dev->bus && urb->dev->bus->op)) | 468 | if (!(urb && urb->dev && urb->dev->bus)) |
472 | return; | 469 | return; |
473 | spin_lock_irq(&urb->lock); | 470 | spin_lock_irq(&urb->lock); |
474 | ++urb->reject; | 471 | ++urb->reject; |
475 | spin_unlock_irq(&urb->lock); | 472 | spin_unlock_irq(&urb->lock); |
476 | 473 | ||
477 | urb->dev->bus->op->unlink_urb(urb, -ENOENT); | 474 | usb_hcd_unlink_urb(urb, -ENOENT); |
478 | wait_event(usb_kill_urb_queue, atomic_read(&urb->use_count) == 0); | 475 | wait_event(usb_kill_urb_queue, atomic_read(&urb->use_count) == 0); |
479 | 476 | ||
480 | spin_lock_irq(&urb->lock); | 477 | spin_lock_irq(&urb->lock); |