Commit ee906470 authored by Geyslan G. Bem's avatar Geyslan G. Bem Committed by Greg Kroah-Hartman

usb: host: ehci-sched: remove prohibited spaces

This patch removes prohibited spaces before open parenthesis and open
brackets.

It also removes an assignment inside condition and unnecessary braces in
single statement block.

Tested by compilation only.
Caught by checkpatch.
Signed-off-by: default avatarGeyslan G. Bem <geyslan@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 189b8ff0
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
* pre-calculated schedule data to make appending to the queue be quick. * pre-calculated schedule data to make appending to the queue be quick.
*/ */
static int ehci_get_frame (struct usb_hcd *hcd); static int ehci_get_frame(struct usb_hcd *hcd);
/* /*
* periodic_next_shadow - return "next" pointer on shadow list * periodic_next_shadow - return "next" pointer on shadow list
...@@ -73,7 +73,7 @@ shadow_next_periodic(struct ehci_hcd *ehci, union ehci_shadow *periodic, ...@@ -73,7 +73,7 @@ shadow_next_periodic(struct ehci_hcd *ehci, union ehci_shadow *periodic,
} }
/* caller must hold ehci->lock */ /* caller must hold ehci->lock */
static void periodic_unlink (struct ehci_hcd *ehci, unsigned frame, void *ptr) static void periodic_unlink(struct ehci_hcd *ehci, unsigned frame, void *ptr)
{ {
union ehci_shadow *prev_p = &ehci->pshadow[frame]; union ehci_shadow *prev_p = &ehci->pshadow[frame];
__hc32 *hw_p = &ehci->periodic[frame]; __hc32 *hw_p = &ehci->periodic[frame];
...@@ -375,7 +375,7 @@ static inline void carryover_tt_bandwidth(unsigned short tt_usecs[8]) ...@@ -375,7 +375,7 @@ static inline void carryover_tt_bandwidth(unsigned short tt_usecs[8])
* limit of 16, specified in USB 2.0 spec section 11.18.4 requirement #4, * limit of 16, specified in USB 2.0 spec section 11.18.4 requirement #4,
* since proper scheduling limits ssplits to less than 16 per uframe. * since proper scheduling limits ssplits to less than 16 per uframe.
*/ */
static int tt_available ( static int tt_available(
struct ehci_hcd *ehci, struct ehci_hcd *ehci,
struct ehci_per_sched *ps, struct ehci_per_sched *ps,
struct ehci_tt *tt, struct ehci_tt *tt,
...@@ -435,7 +435,7 @@ static int tt_available ( ...@@ -435,7 +435,7 @@ static int tt_available (
* for a periodic transfer starting at the specified frame, using * for a periodic transfer starting at the specified frame, using
* all the uframes in the mask. * all the uframes in the mask.
*/ */
static int tt_no_collision ( static int tt_no_collision(
struct ehci_hcd *ehci, struct ehci_hcd *ehci,
unsigned period, unsigned period,
struct usb_device *dev, struct usb_device *dev,
...@@ -455,8 +455,8 @@ static int tt_no_collision ( ...@@ -455,8 +455,8 @@ static int tt_no_collision (
__hc32 type; __hc32 type;
struct ehci_qh_hw *hw; struct ehci_qh_hw *hw;
here = ehci->pshadow [frame]; here = ehci->pshadow[frame];
type = Q_NEXT_TYPE(ehci, ehci->periodic [frame]); type = Q_NEXT_TYPE(ehci, ehci->periodic[frame]);
while (here.ptr) { while (here.ptr) {
switch (hc32_to_cpu(ehci, type)) { switch (hc32_to_cpu(ehci, type)) {
case Q_TYPE_ITD: case Q_TYPE_ITD:
...@@ -479,7 +479,7 @@ static int tt_no_collision ( ...@@ -479,7 +479,7 @@ static int tt_no_collision (
here = here.qh->qh_next; here = here.qh->qh_next;
continue; continue;
case Q_TYPE_SITD: case Q_TYPE_SITD:
if (same_tt (dev, here.sitd->urb->dev)) { if (same_tt(dev, here.sitd->urb->dev)) {
u16 mask; u16 mask;
mask = hc32_to_cpu(ehci, here.sitd mask = hc32_to_cpu(ehci, here.sitd
...@@ -494,7 +494,7 @@ static int tt_no_collision ( ...@@ -494,7 +494,7 @@ static int tt_no_collision (
continue; continue;
// case Q_TYPE_FSTN: // case Q_TYPE_FSTN:
default: default:
ehci_dbg (ehci, ehci_dbg(ehci,
"periodic frame %d bogus type %d\n", "periodic frame %d bogus type %d\n",
frame, type); frame, type);
} }
...@@ -588,9 +588,9 @@ static void qh_link_periodic(struct ehci_hcd *ehci, struct ehci_qh *qh) ...@@ -588,9 +588,9 @@ static void qh_link_periodic(struct ehci_hcd *ehci, struct ehci_qh *qh)
qh->qh_next = here; qh->qh_next = here;
if (here.qh) if (here.qh)
qh->hw->hw_next = *hw_p; qh->hw->hw_next = *hw_p;
wmb (); wmb();
prev->qh = qh; prev->qh = qh;
*hw_p = QH_NEXT (ehci, qh->qh_dma); *hw_p = QH_NEXT(ehci, qh->qh_dma);
} }
} }
qh->qh_state = QH_STATE_LINKED; qh->qh_state = QH_STATE_LINKED;
...@@ -633,7 +633,7 @@ static void qh_unlink_periodic(struct ehci_hcd *ehci, struct ehci_qh *qh) ...@@ -633,7 +633,7 @@ static void qh_unlink_periodic(struct ehci_hcd *ehci, struct ehci_qh *qh)
period = qh->ps.period ? : 1; period = qh->ps.period ? : 1;
for (i = qh->ps.phase; i < ehci->periodic_size; i += period) for (i = qh->ps.phase; i < ehci->periodic_size; i += period)
periodic_unlink (ehci, i, qh); periodic_unlink(ehci, i, qh);
/* update per-qh bandwidth for debugfs */ /* update per-qh bandwidth for debugfs */
ehci_to_hcd(ehci)->self.bandwidth_allocated -= qh->ps.bw_period ehci_to_hcd(ehci)->self.bandwidth_allocated -= qh->ps.bw_period
...@@ -679,7 +679,7 @@ static void start_unlink_intr(struct ehci_hcd *ehci, struct ehci_qh *qh) ...@@ -679,7 +679,7 @@ static void start_unlink_intr(struct ehci_hcd *ehci, struct ehci_qh *qh)
/* if the qh is waiting for unlink, cancel it now */ /* if the qh is waiting for unlink, cancel it now */
cancel_unlink_wait_intr(ehci, qh); cancel_unlink_wait_intr(ehci, qh);
qh_unlink_periodic (ehci, qh); qh_unlink_periodic(ehci, qh);
/* Make sure the unlinks are visible before starting the timer */ /* Make sure the unlinks are visible before starting the timer */
wmb(); wmb();
...@@ -763,7 +763,7 @@ static void end_unlink_intr(struct ehci_hcd *ehci, struct ehci_qh *qh) ...@@ -763,7 +763,7 @@ static void end_unlink_intr(struct ehci_hcd *ehci, struct ehci_qh *qh)
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
static int check_period ( static int check_period(
struct ehci_hcd *ehci, struct ehci_hcd *ehci,
unsigned frame, unsigned frame,
unsigned uframe, unsigned uframe,
...@@ -789,7 +789,7 @@ static int check_period ( ...@@ -789,7 +789,7 @@ static int check_period (
return 1; return 1;
} }
static int check_intr_schedule ( static int check_intr_schedule(
struct ehci_hcd *ehci, struct ehci_hcd *ehci,
unsigned frame, unsigned frame,
unsigned uframe, unsigned uframe,
...@@ -925,7 +925,7 @@ static int qh_schedule(struct ehci_hcd *ehci, struct ehci_qh *qh) ...@@ -925,7 +925,7 @@ static int qh_schedule(struct ehci_hcd *ehci, struct ehci_qh *qh)
return status; return status;
} }
static int intr_submit ( static int intr_submit(
struct ehci_hcd *ehci, struct ehci_hcd *ehci,
struct urb *urb, struct urb *urb,
struct list_head *qtd_list, struct list_head *qtd_list,
...@@ -940,7 +940,7 @@ static int intr_submit ( ...@@ -940,7 +940,7 @@ static int intr_submit (
/* get endpoint and transfer/schedule data */ /* get endpoint and transfer/schedule data */
epnum = urb->ep->desc.bEndpointAddress; epnum = urb->ep->desc.bEndpointAddress;
spin_lock_irqsave (&ehci->lock, flags); spin_lock_irqsave(&ehci->lock, flags);
if (unlikely(!HCD_HW_ACCESSIBLE(ehci_to_hcd(ehci)))) { if (unlikely(!HCD_HW_ACCESSIBLE(ehci_to_hcd(ehci)))) {
status = -ESHUTDOWN; status = -ESHUTDOWN;
...@@ -951,20 +951,21 @@ static int intr_submit ( ...@@ -951,20 +951,21 @@ static int intr_submit (
goto done_not_linked; goto done_not_linked;
/* get qh and force any scheduling errors */ /* get qh and force any scheduling errors */
INIT_LIST_HEAD (&empty); INIT_LIST_HEAD(&empty);
qh = qh_append_tds(ehci, urb, &empty, epnum, &urb->ep->hcpriv); qh = qh_append_tds(ehci, urb, &empty, epnum, &urb->ep->hcpriv);
if (qh == NULL) { if (qh == NULL) {
status = -ENOMEM; status = -ENOMEM;
goto done; goto done;
} }
if (qh->qh_state == QH_STATE_IDLE) { if (qh->qh_state == QH_STATE_IDLE) {
if ((status = qh_schedule (ehci, qh)) != 0) status = qh_schedule(ehci, qh);
if (status)
goto done; goto done;
} }
/* then queue the urb's tds to the qh */ /* then queue the urb's tds to the qh */
qh = qh_append_tds(ehci, urb, qtd_list, epnum, &urb->ep->hcpriv); qh = qh_append_tds(ehci, urb, qtd_list, epnum, &urb->ep->hcpriv);
BUG_ON (qh == NULL); BUG_ON(qh == NULL);
/* stuff into the periodic schedule */ /* stuff into the periodic schedule */
if (qh->qh_state == QH_STATE_IDLE) { if (qh->qh_state == QH_STATE_IDLE) {
...@@ -982,9 +983,9 @@ static int intr_submit ( ...@@ -982,9 +983,9 @@ static int intr_submit (
if (unlikely(status)) if (unlikely(status))
usb_hcd_unlink_urb_from_ep(ehci_to_hcd(ehci), urb); usb_hcd_unlink_urb_from_ep(ehci_to_hcd(ehci), urb);
done_not_linked: done_not_linked:
spin_unlock_irqrestore (&ehci->lock, flags); spin_unlock_irqrestore(&ehci->lock, flags);
if (status) if (status)
qtd_list_free (ehci, urb, qtd_list); qtd_list_free(ehci, urb, qtd_list);
return status; return status;
} }
...@@ -1022,12 +1023,12 @@ static void scan_intr(struct ehci_hcd *ehci) ...@@ -1022,12 +1023,12 @@ static void scan_intr(struct ehci_hcd *ehci)
/* ehci_iso_stream ops work with both ITD and SITD */ /* ehci_iso_stream ops work with both ITD and SITD */
static struct ehci_iso_stream * static struct ehci_iso_stream *
iso_stream_alloc (gfp_t mem_flags) iso_stream_alloc(gfp_t mem_flags)
{ {
struct ehci_iso_stream *stream; struct ehci_iso_stream *stream;
stream = kzalloc(sizeof *stream, mem_flags); stream = kzalloc(sizeof *stream, mem_flags);
if (likely (stream != NULL)) { if (likely(stream != NULL)) {
INIT_LIST_HEAD(&stream->td_list); INIT_LIST_HEAD(&stream->td_list);
INIT_LIST_HEAD(&stream->free_list); INIT_LIST_HEAD(&stream->free_list);
stream->next_uframe = NO_FRAME; stream->next_uframe = NO_FRAME;
...@@ -1037,13 +1038,13 @@ iso_stream_alloc (gfp_t mem_flags) ...@@ -1037,13 +1038,13 @@ iso_stream_alloc (gfp_t mem_flags)
} }
static void static void
iso_stream_init ( iso_stream_init(
struct ehci_hcd *ehci, struct ehci_hcd *ehci,
struct ehci_iso_stream *stream, struct ehci_iso_stream *stream,
struct urb *urb struct urb *urb
) )
{ {
static const u8 smask_out [] = { 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f }; static const u8 smask_out[] = { 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f };
struct usb_device *dev = urb->dev; struct usb_device *dev = urb->dev;
u32 buf1; u32 buf1;
...@@ -1111,7 +1112,7 @@ iso_stream_init ( ...@@ -1111,7 +1112,7 @@ iso_stream_init (
think_time = dev->tt ? dev->tt->think_time : 0; think_time = dev->tt ? dev->tt->think_time : 0;
stream->ps.tt_usecs = NS_TO_US(think_time + usb_calc_bus_time( stream->ps.tt_usecs = NS_TO_US(think_time + usb_calc_bus_time(
dev->speed, is_input, 1, maxp)); dev->speed, is_input, 1, maxp));
hs_transfers = max (1u, (maxp + 187) / 188); hs_transfers = max(1u, (maxp + 187) / 188);
if (is_input) { if (is_input) {
u32 tmp; u32 tmp;
...@@ -1151,7 +1152,7 @@ iso_stream_init ( ...@@ -1151,7 +1152,7 @@ iso_stream_init (
} }
static struct ehci_iso_stream * static struct ehci_iso_stream *
iso_stream_find (struct ehci_hcd *ehci, struct urb *urb) iso_stream_find(struct ehci_hcd *ehci, struct urb *urb)
{ {
unsigned epnum; unsigned epnum;
struct ehci_iso_stream *stream; struct ehci_iso_stream *stream;
...@@ -1164,25 +1165,25 @@ iso_stream_find (struct ehci_hcd *ehci, struct urb *urb) ...@@ -1164,25 +1165,25 @@ iso_stream_find (struct ehci_hcd *ehci, struct urb *urb)
else else
ep = urb->dev->ep_out[epnum]; ep = urb->dev->ep_out[epnum];
spin_lock_irqsave (&ehci->lock, flags); spin_lock_irqsave(&ehci->lock, flags);
stream = ep->hcpriv; stream = ep->hcpriv;
if (unlikely (stream == NULL)) { if (unlikely(stream == NULL)) {
stream = iso_stream_alloc(GFP_ATOMIC); stream = iso_stream_alloc(GFP_ATOMIC);
if (likely (stream != NULL)) { if (likely(stream != NULL)) {
ep->hcpriv = stream; ep->hcpriv = stream;
iso_stream_init(ehci, stream, urb); iso_stream_init(ehci, stream, urb);
} }
/* if dev->ep [epnum] is a QH, hw is set */ /* if dev->ep [epnum] is a QH, hw is set */
} else if (unlikely (stream->hw != NULL)) { } else if (unlikely(stream->hw != NULL)) {
ehci_dbg (ehci, "dev %s ep%d%s, not iso??\n", ehci_dbg(ehci, "dev %s ep%d%s, not iso??\n",
urb->dev->devpath, epnum, urb->dev->devpath, epnum,
usb_pipein(urb->pipe) ? "in" : "out"); usb_pipein(urb->pipe) ? "in" : "out");
stream = NULL; stream = NULL;
} }
spin_unlock_irqrestore (&ehci->lock, flags); spin_unlock_irqrestore(&ehci->lock, flags);
return stream; return stream;
} }
...@@ -1191,16 +1192,16 @@ iso_stream_find (struct ehci_hcd *ehci, struct urb *urb) ...@@ -1191,16 +1192,16 @@ iso_stream_find (struct ehci_hcd *ehci, struct urb *urb)
/* ehci_iso_sched ops can be ITD-only or SITD-only */ /* ehci_iso_sched ops can be ITD-only or SITD-only */
static struct ehci_iso_sched * static struct ehci_iso_sched *
iso_sched_alloc (unsigned packets, gfp_t mem_flags) iso_sched_alloc(unsigned packets, gfp_t mem_flags)
{ {
struct ehci_iso_sched *iso_sched; struct ehci_iso_sched *iso_sched;
int size = sizeof *iso_sched; int size = sizeof *iso_sched;
size += packets * sizeof (struct ehci_iso_packet); size += packets * sizeof(struct ehci_iso_packet);
iso_sched = kzalloc(size, mem_flags); iso_sched = kzalloc(size, mem_flags);
if (likely (iso_sched != NULL)) { if (likely(iso_sched != NULL))
INIT_LIST_HEAD (&iso_sched->td_list); INIT_LIST_HEAD(&iso_sched->td_list);
}
return iso_sched; return iso_sched;
} }
...@@ -1222,17 +1223,17 @@ itd_sched_init( ...@@ -1222,17 +1223,17 @@ itd_sched_init(
* when we fit new itds into the schedule. * when we fit new itds into the schedule.
*/ */
for (i = 0; i < urb->number_of_packets; i++) { for (i = 0; i < urb->number_of_packets; i++) {
struct ehci_iso_packet *uframe = &iso_sched->packet [i]; struct ehci_iso_packet *uframe = &iso_sched->packet[i];
unsigned length; unsigned length;
dma_addr_t buf; dma_addr_t buf;
u32 trans; u32 trans;
length = urb->iso_frame_desc [i].length; length = urb->iso_frame_desc[i].length;
buf = dma + urb->iso_frame_desc [i].offset; buf = dma + urb->iso_frame_desc[i].offset;
trans = EHCI_ISOC_ACTIVE; trans = EHCI_ISOC_ACTIVE;
trans |= buf & 0x0fff; trans |= buf & 0x0fff;
if (unlikely (((i + 1) == urb->number_of_packets)) if (unlikely(((i + 1) == urb->number_of_packets))
&& !(urb->transfer_flags & URB_NO_INTERRUPT)) && !(urb->transfer_flags & URB_NO_INTERRUPT))
trans |= EHCI_ITD_IOC; trans |= EHCI_ITD_IOC;
trans |= length << 16; trans |= length << 16;
...@@ -1241,13 +1242,13 @@ itd_sched_init( ...@@ -1241,13 +1242,13 @@ itd_sched_init(
/* might need to cross a buffer page within a uframe */ /* might need to cross a buffer page within a uframe */
uframe->bufp = (buf & ~(u64)0x0fff); uframe->bufp = (buf & ~(u64)0x0fff);
buf += length; buf += length;
if (unlikely ((uframe->bufp != (buf & ~(u64)0x0fff)))) if (unlikely((uframe->bufp != (buf & ~(u64)0x0fff))))
uframe->cross = 1; uframe->cross = 1;
} }
} }
static void static void
iso_sched_free ( iso_sched_free(
struct ehci_iso_stream *stream, struct ehci_iso_stream *stream,
struct ehci_iso_sched *iso_sched struct ehci_iso_sched *iso_sched
) )
...@@ -1255,12 +1256,12 @@ iso_sched_free ( ...@@ -1255,12 +1256,12 @@ iso_sched_free (
if (!iso_sched) if (!iso_sched)
return; return;
// caller must hold ehci->lock! // caller must hold ehci->lock!
list_splice (&iso_sched->td_list, &stream->free_list); list_splice(&iso_sched->td_list, &stream->free_list);
kfree (iso_sched); kfree(iso_sched);
} }
static int static int
itd_urb_transaction ( itd_urb_transaction(
struct ehci_iso_stream *stream, struct ehci_iso_stream *stream,
struct ehci_hcd *ehci, struct ehci_hcd *ehci,
struct urb *urb, struct urb *urb,
...@@ -1274,8 +1275,8 @@ itd_urb_transaction ( ...@@ -1274,8 +1275,8 @@ itd_urb_transaction (
struct ehci_iso_sched *sched; struct ehci_iso_sched *sched;
unsigned long flags; unsigned long flags;
sched = iso_sched_alloc (urb->number_of_packets, mem_flags); sched = iso_sched_alloc(urb->number_of_packets, mem_flags);
if (unlikely (sched == NULL)) if (unlikely(sched == NULL))
return -ENOMEM; return -ENOMEM;
itd_sched_init(ehci, sched, stream, urb); itd_sched_init(ehci, sched, stream, urb);
...@@ -1286,7 +1287,7 @@ itd_urb_transaction ( ...@@ -1286,7 +1287,7 @@ itd_urb_transaction (
num_itds = urb->number_of_packets; num_itds = urb->number_of_packets;
/* allocate/init ITDs */ /* allocate/init ITDs */
spin_lock_irqsave (&ehci->lock, flags); spin_lock_irqsave(&ehci->lock, flags);
for (i = 0; i < num_itds; i++) { for (i = 0; i < num_itds; i++) {
/* /*
...@@ -1298,14 +1299,14 @@ itd_urb_transaction ( ...@@ -1298,14 +1299,14 @@ itd_urb_transaction (
struct ehci_itd, itd_list); struct ehci_itd, itd_list);
if (itd->frame == ehci->now_frame) if (itd->frame == ehci->now_frame)
goto alloc_itd; goto alloc_itd;
list_del (&itd->itd_list); list_del(&itd->itd_list);
itd_dma = itd->itd_dma; itd_dma = itd->itd_dma;
} else { } else {
alloc_itd: alloc_itd:
spin_unlock_irqrestore (&ehci->lock, flags); spin_unlock_irqrestore(&ehci->lock, flags);
itd = dma_pool_alloc (ehci->itd_pool, mem_flags, itd = dma_pool_alloc(ehci->itd_pool, mem_flags,
&itd_dma); &itd_dma);
spin_lock_irqsave (&ehci->lock, flags); spin_lock_irqsave(&ehci->lock, flags);
if (!itd) { if (!itd) {
iso_sched_free(stream, sched); iso_sched_free(stream, sched);
spin_unlock_irqrestore(&ehci->lock, flags); spin_unlock_irqrestore(&ehci->lock, flags);
...@@ -1313,12 +1314,12 @@ itd_urb_transaction ( ...@@ -1313,12 +1314,12 @@ itd_urb_transaction (
} }
} }
memset (itd, 0, sizeof *itd); memset(itd, 0, sizeof *itd);
itd->itd_dma = itd_dma; itd->itd_dma = itd_dma;
itd->frame = NO_FRAME; itd->frame = NO_FRAME;
list_add (&itd->itd_list, &sched->td_list); list_add(&itd->itd_list, &sched->td_list);
} }
spin_unlock_irqrestore (&ehci->lock, flags); spin_unlock_irqrestore(&ehci->lock, flags);
/* temporarily store schedule info in hcpriv */ /* temporarily store schedule info in hcpriv */
urb->hcpriv = sched; urb->hcpriv = sched;
...@@ -1385,7 +1386,7 @@ static void reserve_release_iso_bandwidth(struct ehci_hcd *ehci, ...@@ -1385,7 +1386,7 @@ static void reserve_release_iso_bandwidth(struct ehci_hcd *ehci,
} }
static inline int static inline int
itd_slot_ok ( itd_slot_ok(
struct ehci_hcd *ehci, struct ehci_hcd *ehci,
struct ehci_iso_stream *stream, struct ehci_iso_stream *stream,
unsigned uframe unsigned uframe
...@@ -1405,7 +1406,7 @@ itd_slot_ok ( ...@@ -1405,7 +1406,7 @@ itd_slot_ok (
} }
static inline int static inline int
sitd_slot_ok ( sitd_slot_ok(
struct ehci_hcd *ehci, struct ehci_hcd *ehci,
struct ehci_iso_stream *stream, struct ehci_iso_stream *stream,
unsigned uframe, unsigned uframe,
...@@ -1492,7 +1493,7 @@ sitd_slot_ok ( ...@@ -1492,7 +1493,7 @@ sitd_slot_ok (
*/ */
static int static int
iso_stream_schedule ( iso_stream_schedule(
struct ehci_hcd *ehci, struct ehci_hcd *ehci,
struct urb *urb, struct urb *urb,
struct ehci_iso_stream *stream struct ehci_iso_stream *stream
...@@ -1693,9 +1694,9 @@ itd_init(struct ehci_hcd *ehci, struct ehci_iso_stream *stream, ...@@ -1693,9 +1694,9 @@ itd_init(struct ehci_hcd *ehci, struct ehci_iso_stream *stream,
/* it's been recently zeroed */ /* it's been recently zeroed */
itd->hw_next = EHCI_LIST_END(ehci); itd->hw_next = EHCI_LIST_END(ehci);
itd->hw_bufp [0] = stream->buf0; itd->hw_bufp[0] = stream->buf0;
itd->hw_bufp [1] = stream->buf1; itd->hw_bufp[1] = stream->buf1;
itd->hw_bufp [2] = stream->buf2; itd->hw_bufp[2] = stream->buf2;
for (i = 0; i < 8; i++) for (i = 0; i < 8; i++)
itd->index[i] = -1; itd->index[i] = -1;
...@@ -1712,13 +1713,13 @@ itd_patch( ...@@ -1712,13 +1713,13 @@ itd_patch(
u16 uframe u16 uframe
) )
{ {
struct ehci_iso_packet *uf = &iso_sched->packet [index]; struct ehci_iso_packet *uf = &iso_sched->packet[index];
unsigned pg = itd->pg; unsigned pg = itd->pg;
// BUG_ON (pg == 6 && uf->cross); // BUG_ON (pg == 6 && uf->cross);
uframe &= 0x07; uframe &= 0x07;
itd->index [uframe] = index; itd->index[uframe] = index;
itd->hw_transaction[uframe] = uf->transaction; itd->hw_transaction[uframe] = uf->transaction;
itd->hw_transaction[uframe] |= cpu_to_hc32(ehci, pg << 12); itd->hw_transaction[uframe] |= cpu_to_hc32(ehci, pg << 12);
...@@ -1726,7 +1727,7 @@ itd_patch( ...@@ -1726,7 +1727,7 @@ itd_patch(
itd->hw_bufp_hi[pg] |= cpu_to_hc32(ehci, (u32)(uf->bufp >> 32)); itd->hw_bufp_hi[pg] |= cpu_to_hc32(ehci, (u32)(uf->bufp >> 32));
/* iso_frame_desc[].offset must be strictly increasing */ /* iso_frame_desc[].offset must be strictly increasing */
if (unlikely (uf->cross)) { if (unlikely(uf->cross)) {
u64 bufp = uf->bufp + 4096; u64 bufp = uf->bufp + 4096;
itd->pg = ++pg; itd->pg = ++pg;
...@@ -1736,7 +1737,7 @@ itd_patch( ...@@ -1736,7 +1737,7 @@ itd_patch(
} }
static inline void static inline void
itd_link (struct ehci_hcd *ehci, unsigned frame, struct ehci_itd *itd) itd_link(struct ehci_hcd *ehci, unsigned frame, struct ehci_itd *itd)
{ {
union ehci_shadow *prev = &ehci->pshadow[frame]; union ehci_shadow *prev = &ehci->pshadow[frame];
__hc32 *hw_p = &ehci->periodic[frame]; __hc32 *hw_p = &ehci->periodic[frame];
...@@ -1757,7 +1758,7 @@ itd_link (struct ehci_hcd *ehci, unsigned frame, struct ehci_itd *itd) ...@@ -1757,7 +1758,7 @@ itd_link (struct ehci_hcd *ehci, unsigned frame, struct ehci_itd *itd)
itd->hw_next = *hw_p; itd->hw_next = *hw_p;
prev->itd = itd; prev->itd = itd;
itd->frame = frame; itd->frame = frame;
wmb (); wmb();
*hw_p = cpu_to_hc32(ehci, itd->itd_dma | Q_TYPE_ITD); *hw_p = cpu_to_hc32(ehci, itd->itd_dma | Q_TYPE_ITD);
} }
...@@ -1776,7 +1777,7 @@ static void itd_link_urb( ...@@ -1776,7 +1777,7 @@ static void itd_link_urb(
next_uframe = stream->next_uframe & (mod - 1); next_uframe = stream->next_uframe & (mod - 1);
if (unlikely (list_empty(&stream->td_list))) if (unlikely(list_empty(&stream->td_list)))
ehci_to_hcd(ehci)->self.bandwidth_allocated ehci_to_hcd(ehci)->self.bandwidth_allocated
+= stream->bandwidth; += stream->bandwidth;
...@@ -1796,12 +1797,12 @@ static void itd_link_urb( ...@@ -1796,12 +1797,12 @@ static void itd_link_urb(
/* ASSERT: no itds for this endpoint in this uframe */ /* ASSERT: no itds for this endpoint in this uframe */
itd = list_entry (iso_sched->td_list.next, itd = list_entry(iso_sched->td_list.next,
struct ehci_itd, itd_list); struct ehci_itd, itd_list);
list_move_tail (&itd->itd_list, &stream->td_list); list_move_tail(&itd->itd_list, &stream->td_list);
itd->stream = stream; itd->stream = stream;
itd->urb = urb; itd->urb = urb;
itd_init (ehci, stream, itd); itd_init(ehci, stream, itd);
} }
uframe = next_uframe & 0x07; uframe = next_uframe & 0x07;
...@@ -1823,7 +1824,7 @@ static void itd_link_urb( ...@@ -1823,7 +1824,7 @@ static void itd_link_urb(
stream->next_uframe = next_uframe; stream->next_uframe = next_uframe;
/* don't need that schedule data any more */ /* don't need that schedule data any more */
iso_sched_free (stream, iso_sched); iso_sched_free(stream, iso_sched);
urb->hcpriv = stream; urb->hcpriv = stream;
++ehci->isoc_count; ++ehci->isoc_count;
...@@ -1855,19 +1856,19 @@ static bool itd_complete(struct ehci_hcd *ehci, struct ehci_itd *itd) ...@@ -1855,19 +1856,19 @@ static bool itd_complete(struct ehci_hcd *ehci, struct ehci_itd *itd)
/* for each uframe with a packet */ /* for each uframe with a packet */
for (uframe = 0; uframe < 8; uframe++) { for (uframe = 0; uframe < 8; uframe++) {
if (likely (itd->index[uframe] == -1)) if (likely(itd->index[uframe] == -1))
continue; continue;
urb_index = itd->index[uframe]; urb_index = itd->index[uframe];
desc = &urb->iso_frame_desc [urb_index]; desc = &urb->iso_frame_desc[urb_index];
t = hc32_to_cpup(ehci, &itd->hw_transaction [uframe]); t = hc32_to_cpup(ehci, &itd->hw_transaction[uframe]);
itd->hw_transaction [uframe] = 0; itd->hw_transaction[uframe] = 0;
/* report transfer status */ /* report transfer status */
if (unlikely (t & ISO_ERRS)) { if (unlikely(t & ISO_ERRS)) {
urb->error_count++; urb->error_count++;
if (t & EHCI_ISOC_BUF_ERR) if (t & EHCI_ISOC_BUF_ERR)
desc->status = usb_pipein (urb->pipe) desc->status = usb_pipein(urb->pipe)
? -ENOSR /* hc couldn't read */ ? -ENOSR /* hc couldn't read */
: -ECOMM; /* hc couldn't write */ : -ECOMM; /* hc couldn't write */
else if (t & EHCI_ISOC_BABBLE) else if (t & EHCI_ISOC_BABBLE)
...@@ -1880,7 +1881,7 @@ static bool itd_complete(struct ehci_hcd *ehci, struct ehci_itd *itd) ...@@ -1880,7 +1881,7 @@ static bool itd_complete(struct ehci_hcd *ehci, struct ehci_itd *itd)
desc->actual_length = EHCI_ITD_LENGTH(t); desc->actual_length = EHCI_ITD_LENGTH(t);
urb->actual_length += desc->actual_length; urb->actual_length += desc->actual_length;
} }
} else if (likely ((t & EHCI_ISOC_ACTIVE) == 0)) { } else if (likely((t & EHCI_ISOC_ACTIVE) == 0)) {
desc->status = 0; desc->status = 0;
desc->actual_length = EHCI_ITD_LENGTH(t); desc->actual_length = EHCI_ITD_LENGTH(t);
urb->actual_length += desc->actual_length; urb->actual_length += desc->actual_length;
...@@ -1891,7 +1892,7 @@ static bool itd_complete(struct ehci_hcd *ehci, struct ehci_itd *itd) ...@@ -1891,7 +1892,7 @@ static bool itd_complete(struct ehci_hcd *ehci, struct ehci_itd *itd)
} }
/* handle completion now? */ /* handle completion now? */
if (likely ((urb_index + 1) != urb->number_of_packets)) if (likely((urb_index + 1) != urb->number_of_packets))
goto done; goto done;
/* ASSERT: it's really the last itd for this urb /* ASSERT: it's really the last itd for this urb
...@@ -1936,7 +1937,7 @@ static bool itd_complete(struct ehci_hcd *ehci, struct ehci_itd *itd) ...@@ -1936,7 +1937,7 @@ static bool itd_complete(struct ehci_hcd *ehci, struct ehci_itd *itd)
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
static int itd_submit (struct ehci_hcd *ehci, struct urb *urb, static int itd_submit(struct ehci_hcd *ehci, struct urb *urb,
gfp_t mem_flags) gfp_t mem_flags)
{ {
int status = -EINVAL; int status = -EINVAL;
...@@ -1944,37 +1945,37 @@ static int itd_submit (struct ehci_hcd *ehci, struct urb *urb, ...@@ -1944,37 +1945,37 @@ static int itd_submit (struct ehci_hcd *ehci, struct urb *urb,
struct ehci_iso_stream *stream; struct ehci_iso_stream *stream;
/* Get iso_stream head */ /* Get iso_stream head */
stream = iso_stream_find (ehci, urb); stream = iso_stream_find(ehci, urb);
if (unlikely (stream == NULL)) { if (unlikely(stream == NULL)) {
ehci_dbg (ehci, "can't get iso stream\n"); ehci_dbg(ehci, "can't get iso stream\n");
return -ENOMEM; return -ENOMEM;
} }
if (unlikely(urb->interval != stream->uperiod)) { if (unlikely(urb->interval != stream->uperiod)) {
ehci_dbg (ehci, "can't change iso interval %d --> %d\n", ehci_dbg(ehci, "can't change iso interval %d --> %d\n",
stream->uperiod, urb->interval); stream->uperiod, urb->interval);
goto done; goto done;
} }
#ifdef EHCI_URB_TRACE #ifdef EHCI_URB_TRACE
ehci_dbg (ehci, ehci_dbg(ehci,
"%s %s urb %p ep%d%s len %d, %d pkts %d uframes [%p]\n", "%s %s urb %p ep%d%s len %d, %d pkts %d uframes [%p]\n",
__func__, urb->dev->devpath, urb, __func__, urb->dev->devpath, urb,
usb_pipeendpoint (urb->pipe), usb_pipeendpoint(urb->pipe),
usb_pipein (urb->pipe) ? "in" : "out", usb_pipein(urb->pipe) ? "in" : "out",
urb->transfer_buffer_length, urb->transfer_buffer_length,
urb->number_of_packets, urb->interval, urb->number_of_packets, urb->interval,
stream); stream);
#endif #endif
/* allocate ITDs w/o locking anything */ /* allocate ITDs w/o locking anything */
status = itd_urb_transaction (stream, ehci, urb, mem_flags); status = itd_urb_transaction(stream, ehci, urb, mem_flags);
if (unlikely (status < 0)) { if (unlikely(status < 0)) {
ehci_dbg (ehci, "can't init itds\n"); ehci_dbg(ehci, "can't init itds\n");
goto done; goto done;
} }
/* schedule ... need to lock */ /* schedule ... need to lock */
spin_lock_irqsave (&ehci->lock, flags); spin_lock_irqsave(&ehci->lock, flags);
if (unlikely(!HCD_HW_ACCESSIBLE(ehci_to_hcd(ehci)))) { if (unlikely(!HCD_HW_ACCESSIBLE(ehci_to_hcd(ehci)))) {
status = -ESHUTDOWN; status = -ESHUTDOWN;
goto done_not_linked; goto done_not_linked;
...@@ -1984,7 +1985,7 @@ static int itd_submit (struct ehci_hcd *ehci, struct urb *urb, ...@@ -1984,7 +1985,7 @@ static int itd_submit (struct ehci_hcd *ehci, struct urb *urb,
goto done_not_linked; goto done_not_linked;
status = iso_stream_schedule(ehci, urb, stream); status = iso_stream_schedule(ehci, urb, stream);
if (likely(status == 0)) { if (likely(status == 0)) {
itd_link_urb (ehci, urb, ehci->periodic_size << 3, stream); itd_link_urb(ehci, urb, ehci->periodic_size << 3, stream);
} else if (status > 0) { } else if (status > 0) {
status = 0; status = 0;
ehci_urb_done(ehci, urb, 0); ehci_urb_done(ehci, urb, 0);
...@@ -1992,7 +1993,7 @@ static int itd_submit (struct ehci_hcd *ehci, struct urb *urb, ...@@ -1992,7 +1993,7 @@ static int itd_submit (struct ehci_hcd *ehci, struct urb *urb,
usb_hcd_unlink_urb_from_ep(ehci_to_hcd(ehci), urb); usb_hcd_unlink_urb_from_ep(ehci_to_hcd(ehci), urb);
} }
done_not_linked: done_not_linked:
spin_unlock_irqrestore (&ehci->lock, flags); spin_unlock_irqrestore(&ehci->lock, flags);
done: done:
return status; return status;
} }
...@@ -2022,13 +2023,13 @@ sitd_sched_init( ...@@ -2022,13 +2023,13 @@ sitd_sched_init(
* when we fit new sitds into the schedule. * when we fit new sitds into the schedule.
*/ */
for (i = 0; i < urb->number_of_packets; i++) { for (i = 0; i < urb->number_of_packets; i++) {
struct ehci_iso_packet *packet = &iso_sched->packet [i]; struct ehci_iso_packet *packet = &iso_sched->packet[i];
unsigned length; unsigned length;
dma_addr_t buf; dma_addr_t buf;
u32 trans; u32 trans;
length = urb->iso_frame_desc [i].length & 0x03ff; length = urb->iso_frame_desc[i].length & 0x03ff;
buf = dma + urb->iso_frame_desc [i].offset; buf = dma + urb->iso_frame_desc[i].offset;
trans = SITD_STS_ACTIVE; trans = SITD_STS_ACTIVE;
if (((i + 1) == urb->number_of_packets) if (((i + 1) == urb->number_of_packets)
...@@ -2054,7 +2055,7 @@ sitd_sched_init( ...@@ -2054,7 +2055,7 @@ sitd_sched_init(
} }
static int static int
sitd_urb_transaction ( sitd_urb_transaction(
struct ehci_iso_stream *stream, struct ehci_iso_stream *stream,
struct ehci_hcd *ehci, struct ehci_hcd *ehci,
struct urb *urb, struct urb *urb,
...@@ -2067,14 +2068,14 @@ sitd_urb_transaction ( ...@@ -2067,14 +2068,14 @@ sitd_urb_transaction (
struct ehci_iso_sched *iso_sched; struct ehci_iso_sched *iso_sched;
unsigned long flags; unsigned long flags;
iso_sched = iso_sched_alloc (urb->number_of_packets, mem_flags); iso_sched = iso_sched_alloc(urb->number_of_packets, mem_flags);
if (iso_sched == NULL) if (iso_sched == NULL)
return -ENOMEM; return -ENOMEM;
sitd_sched_init(ehci, iso_sched, stream, urb); sitd_sched_init(ehci, iso_sched, stream, urb);
/* allocate/init sITDs */ /* allocate/init sITDs */
spin_lock_irqsave (&ehci->lock, flags); spin_lock_irqsave(&ehci->lock, flags);
for (i = 0; i < urb->number_of_packets; i++) { for (i = 0; i < urb->number_of_packets; i++) {
/* NOTE: for now, we don't try to handle wraparound cases /* NOTE: for now, we don't try to handle wraparound cases
...@@ -2091,14 +2092,14 @@ sitd_urb_transaction ( ...@@ -2091,14 +2092,14 @@ sitd_urb_transaction (
struct ehci_sitd, sitd_list); struct ehci_sitd, sitd_list);
if (sitd->frame == ehci->now_frame) if (sitd->frame == ehci->now_frame)
goto alloc_sitd; goto alloc_sitd;
list_del (&sitd->sitd_list); list_del(&sitd->sitd_list);
sitd_dma = sitd->sitd_dma; sitd_dma = sitd->sitd_dma;
} else { } else {
alloc_sitd: alloc_sitd:
spin_unlock_irqrestore (&ehci->lock, flags); spin_unlock_irqrestore(&ehci->lock, flags);
sitd = dma_pool_alloc (ehci->sitd_pool, mem_flags, sitd = dma_pool_alloc(ehci->sitd_pool, mem_flags,
&sitd_dma); &sitd_dma);
spin_lock_irqsave (&ehci->lock, flags); spin_lock_irqsave(&ehci->lock, flags);
if (!sitd) { if (!sitd) {
iso_sched_free(stream, iso_sched); iso_sched_free(stream, iso_sched);
spin_unlock_irqrestore(&ehci->lock, flags); spin_unlock_irqrestore(&ehci->lock, flags);
...@@ -2106,17 +2107,17 @@ sitd_urb_transaction ( ...@@ -2106,17 +2107,17 @@ sitd_urb_transaction (
} }
} }
memset (sitd, 0, sizeof *sitd); memset(sitd, 0, sizeof *sitd);
sitd->sitd_dma = sitd_dma; sitd->sitd_dma = sitd_dma;
sitd->frame = NO_FRAME; sitd->frame = NO_FRAME;
list_add (&sitd->sitd_list, &iso_sched->td_list); list_add(&sitd->sitd_list, &iso_sched->td_list);
} }
/* temporarily store schedule info in hcpriv */ /* temporarily store schedule info in hcpriv */
urb->hcpriv = iso_sched; urb->hcpriv = iso_sched;
urb->error_count = 0; urb->error_count = 0;
spin_unlock_irqrestore (&ehci->lock, flags); spin_unlock_irqrestore(&ehci->lock, flags);
return 0; return 0;
} }
...@@ -2131,7 +2132,7 @@ sitd_patch( ...@@ -2131,7 +2132,7 @@ sitd_patch(
unsigned index unsigned index
) )
{ {
struct ehci_iso_packet *uf = &iso_sched->packet [index]; struct ehci_iso_packet *uf = &iso_sched->packet[index];
u64 bufp; u64 bufp;
sitd->hw_next = EHCI_LIST_END(ehci); sitd->hw_next = EHCI_LIST_END(ehci);
...@@ -2152,14 +2153,14 @@ sitd_patch( ...@@ -2152,14 +2153,14 @@ sitd_patch(
} }
static inline void static inline void
sitd_link (struct ehci_hcd *ehci, unsigned frame, struct ehci_sitd *sitd) sitd_link(struct ehci_hcd *ehci, unsigned frame, struct ehci_sitd *sitd)
{ {
/* note: sitd ordering could matter (CSPLIT then SSPLIT) */ /* note: sitd ordering could matter (CSPLIT then SSPLIT) */
sitd->sitd_next = ehci->pshadow [frame]; sitd->sitd_next = ehci->pshadow[frame];
sitd->hw_next = ehci->periodic [frame]; sitd->hw_next = ehci->periodic[frame];
ehci->pshadow [frame].sitd = sitd; ehci->pshadow[frame].sitd = sitd;
sitd->frame = frame; sitd->frame = frame;
wmb (); wmb();
ehci->periodic[frame] = cpu_to_hc32(ehci, sitd->sitd_dma | Q_TYPE_SITD); ehci->periodic[frame] = cpu_to_hc32(ehci, sitd->sitd_dma | Q_TYPE_SITD);
} }
...@@ -2196,13 +2197,13 @@ static void sitd_link_urb( ...@@ -2196,13 +2197,13 @@ static void sitd_link_urb(
packet++) { packet++) {
/* ASSERT: we have all necessary sitds */ /* ASSERT: we have all necessary sitds */
BUG_ON (list_empty (&sched->td_list)); BUG_ON(list_empty(&sched->td_list));
/* ASSERT: no itds for this endpoint in this frame */ /* ASSERT: no itds for this endpoint in this frame */
sitd = list_entry (sched->td_list.next, sitd = list_entry(sched->td_list.next,
struct ehci_sitd, sitd_list); struct ehci_sitd, sitd_list);
list_move_tail (&sitd->sitd_list, &stream->td_list); list_move_tail(&sitd->sitd_list, &stream->td_list);
sitd->stream = stream; sitd->stream = stream;
sitd->urb = urb; sitd->urb = urb;
...@@ -2215,7 +2216,7 @@ static void sitd_link_urb( ...@@ -2215,7 +2216,7 @@ static void sitd_link_urb(
stream->next_uframe = next_uframe & (mod - 1); stream->next_uframe = next_uframe & (mod - 1);
/* don't need that schedule data any more */ /* don't need that schedule data any more */
iso_sched_free (stream, sched); iso_sched_free(stream, sched);
urb->hcpriv = stream; urb->hcpriv = stream;
++ehci->isoc_count; ++ehci->isoc_count;
...@@ -2248,14 +2249,14 @@ static bool sitd_complete(struct ehci_hcd *ehci, struct ehci_sitd *sitd) ...@@ -2248,14 +2249,14 @@ static bool sitd_complete(struct ehci_hcd *ehci, struct ehci_sitd *sitd)
bool retval = false; bool retval = false;
urb_index = sitd->index; urb_index = sitd->index;
desc = &urb->iso_frame_desc [urb_index]; desc = &urb->iso_frame_desc[urb_index];
t = hc32_to_cpup(ehci, &sitd->hw_results); t = hc32_to_cpup(ehci, &sitd->hw_results);
/* report transfer status */ /* report transfer status */
if (unlikely(t & SITD_ERRS)) { if (unlikely(t & SITD_ERRS)) {
urb->error_count++; urb->error_count++;
if (t & SITD_STS_DBE) if (t & SITD_STS_DBE)
desc->status = usb_pipein (urb->pipe) desc->status = usb_pipein(urb->pipe)
? -ENOSR /* hc couldn't read */ ? -ENOSR /* hc couldn't read */
: -ECOMM; /* hc couldn't write */ : -ECOMM; /* hc couldn't write */
else if (t & SITD_STS_BABBLE) else if (t & SITD_STS_BABBLE)
...@@ -2316,7 +2317,7 @@ static bool sitd_complete(struct ehci_hcd *ehci, struct ehci_sitd *sitd) ...@@ -2316,7 +2317,7 @@ static bool sitd_complete(struct ehci_hcd *ehci, struct ehci_sitd *sitd)
} }
static int sitd_submit (struct ehci_hcd *ehci, struct urb *urb, static int sitd_submit(struct ehci_hcd *ehci, struct urb *urb,
gfp_t mem_flags) gfp_t mem_flags)
{ {
int status = -EINVAL; int status = -EINVAL;
...@@ -2324,35 +2325,35 @@ static int sitd_submit (struct ehci_hcd *ehci, struct urb *urb, ...@@ -2324,35 +2325,35 @@ static int sitd_submit (struct ehci_hcd *ehci, struct urb *urb,
struct ehci_iso_stream *stream; struct ehci_iso_stream *stream;
/* Get iso_stream head */ /* Get iso_stream head */
stream = iso_stream_find (ehci, urb); stream = iso_stream_find(ehci, urb);
if (stream == NULL) { if (stream == NULL) {
ehci_dbg (ehci, "can't get iso stream\n"); ehci_dbg(ehci, "can't get iso stream\n");
return -ENOMEM; return -ENOMEM;
} }
if (urb->interval != stream->ps.period) { if (urb->interval != stream->ps.period) {
ehci_dbg (ehci, "can't change iso interval %d --> %d\n", ehci_dbg(ehci, "can't change iso interval %d --> %d\n",
stream->ps.period, urb->interval); stream->ps.period, urb->interval);
goto done; goto done;
} }
#ifdef EHCI_URB_TRACE #ifdef EHCI_URB_TRACE
ehci_dbg (ehci, ehci_dbg(ehci,
"submit %p dev%s ep%d%s-iso len %d\n", "submit %p dev%s ep%d%s-iso len %d\n",
urb, urb->dev->devpath, urb, urb->dev->devpath,
usb_pipeendpoint (urb->pipe), usb_pipeendpoint(urb->pipe),
usb_pipein (urb->pipe) ? "in" : "out", usb_pipein(urb->pipe) ? "in" : "out",
urb->transfer_buffer_length); urb->transfer_buffer_length);
#endif #endif
/* allocate SITDs */ /* allocate SITDs */
status = sitd_urb_transaction (stream, ehci, urb, mem_flags); status = sitd_urb_transaction(stream, ehci, urb, mem_flags);
if (status < 0) { if (status < 0) {
ehci_dbg (ehci, "can't init sitds\n"); ehci_dbg(ehci, "can't init sitds\n");
goto done; goto done;
} }
/* schedule ... need to lock */ /* schedule ... need to lock */
spin_lock_irqsave (&ehci->lock, flags); spin_lock_irqsave(&ehci->lock, flags);
if (unlikely(!HCD_HW_ACCESSIBLE(ehci_to_hcd(ehci)))) { if (unlikely(!HCD_HW_ACCESSIBLE(ehci_to_hcd(ehci)))) {
status = -ESHUTDOWN; status = -ESHUTDOWN;
goto done_not_linked; goto done_not_linked;
...@@ -2362,7 +2363,7 @@ static int sitd_submit (struct ehci_hcd *ehci, struct urb *urb, ...@@ -2362,7 +2363,7 @@ static int sitd_submit (struct ehci_hcd *ehci, struct urb *urb,
goto done_not_linked; goto done_not_linked;
status = iso_stream_schedule(ehci, urb, stream); status = iso_stream_schedule(ehci, urb, stream);
if (likely(status == 0)) { if (likely(status == 0)) {
sitd_link_urb (ehci, urb, ehci->periodic_size << 3, stream); sitd_link_urb(ehci, urb, ehci->periodic_size << 3, stream);
} else if (status > 0) { } else if (status > 0) {
status = 0; status = 0;
ehci_urb_done(ehci, urb, 0); ehci_urb_done(ehci, urb, 0);
...@@ -2370,7 +2371,7 @@ static int sitd_submit (struct ehci_hcd *ehci, struct urb *urb, ...@@ -2370,7 +2371,7 @@ static int sitd_submit (struct ehci_hcd *ehci, struct urb *urb,
usb_hcd_unlink_urb_from_ep(ehci_to_hcd(ehci), urb); usb_hcd_unlink_urb_from_ep(ehci_to_hcd(ehci), urb);
} }
done_not_linked: done_not_linked:
spin_unlock_irqrestore (&ehci->lock, flags); spin_unlock_irqrestore(&ehci->lock, flags);
done: done:
return status; return status;
} }
......
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