diff options
Diffstat (limited to 'drivers/usb/host/whci')
-rw-r--r-- | drivers/usb/host/whci/asl.c | 23 | ||||
-rw-r--r-- | drivers/usb/host/whci/debug.c | 6 | ||||
-rw-r--r-- | drivers/usb/host/whci/pzl.c | 24 |
3 files changed, 36 insertions, 17 deletions
diff --git a/drivers/usb/host/whci/asl.c b/drivers/usb/host/whci/asl.c index c632437c7649..562eba108816 100644 --- a/drivers/usb/host/whci/asl.c +++ b/drivers/usb/host/whci/asl.c | |||
@@ -115,6 +115,10 @@ static uint32_t process_qset(struct whc *whc, struct whc_qset *qset) | |||
115 | if (status & QTD_STS_HALTED) { | 115 | if (status & QTD_STS_HALTED) { |
116 | /* Ug, an error. */ | 116 | /* Ug, an error. */ |
117 | process_halted_qtd(whc, qset, td); | 117 | process_halted_qtd(whc, qset, td); |
118 | /* A halted qTD always triggers an update | ||
119 | because the qset was either removed or | ||
120 | reactivated. */ | ||
121 | update |= WHC_UPDATE_UPDATED; | ||
118 | goto done; | 122 | goto done; |
119 | } | 123 | } |
120 | 124 | ||
@@ -305,6 +309,7 @@ int asl_urb_dequeue(struct whc *whc, struct urb *urb, int status) | |||
305 | struct whc_urb *wurb = urb->hcpriv; | 309 | struct whc_urb *wurb = urb->hcpriv; |
306 | struct whc_qset *qset = wurb->qset; | 310 | struct whc_qset *qset = wurb->qset; |
307 | struct whc_std *std, *t; | 311 | struct whc_std *std, *t; |
312 | bool has_qtd = false; | ||
308 | int ret; | 313 | int ret; |
309 | unsigned long flags; | 314 | unsigned long flags; |
310 | 315 | ||
@@ -315,17 +320,21 @@ int asl_urb_dequeue(struct whc *whc, struct urb *urb, int status) | |||
315 | goto out; | 320 | goto out; |
316 | 321 | ||
317 | list_for_each_entry_safe(std, t, &qset->stds, list_node) { | 322 | list_for_each_entry_safe(std, t, &qset->stds, list_node) { |
318 | if (std->urb == urb) | 323 | if (std->urb == urb) { |
324 | if (std->qtd) | ||
325 | has_qtd = true; | ||
319 | qset_free_std(whc, std); | 326 | qset_free_std(whc, std); |
320 | else | 327 | } else |
321 | std->qtd = NULL; /* so this std is re-added when the qset is */ | 328 | std->qtd = NULL; /* so this std is re-added when the qset is */ |
322 | } | 329 | } |
323 | 330 | ||
324 | asl_qset_remove(whc, qset); | 331 | if (has_qtd) { |
325 | wurb->status = status; | 332 | asl_qset_remove(whc, qset); |
326 | wurb->is_async = true; | 333 | wurb->status = status; |
327 | queue_work(whc->workqueue, &wurb->dequeue_work); | 334 | wurb->is_async = true; |
328 | 335 | queue_work(whc->workqueue, &wurb->dequeue_work); | |
336 | } else | ||
337 | qset_remove_urb(whc, qset, urb, status); | ||
329 | out: | 338 | out: |
330 | spin_unlock_irqrestore(&whc->lock, flags); | 339 | spin_unlock_irqrestore(&whc->lock, flags); |
331 | 340 | ||
diff --git a/drivers/usb/host/whci/debug.c b/drivers/usb/host/whci/debug.c index cf2d45946c57..2273c815941f 100644 --- a/drivers/usb/host/whci/debug.c +++ b/drivers/usb/host/whci/debug.c | |||
@@ -134,7 +134,7 @@ static int pzl_open(struct inode *inode, struct file *file) | |||
134 | return single_open(file, pzl_print, inode->i_private); | 134 | return single_open(file, pzl_print, inode->i_private); |
135 | } | 135 | } |
136 | 136 | ||
137 | static struct file_operations di_fops = { | 137 | static const struct file_operations di_fops = { |
138 | .open = di_open, | 138 | .open = di_open, |
139 | .read = seq_read, | 139 | .read = seq_read, |
140 | .llseek = seq_lseek, | 140 | .llseek = seq_lseek, |
@@ -142,7 +142,7 @@ static struct file_operations di_fops = { | |||
142 | .owner = THIS_MODULE, | 142 | .owner = THIS_MODULE, |
143 | }; | 143 | }; |
144 | 144 | ||
145 | static struct file_operations asl_fops = { | 145 | static const struct file_operations asl_fops = { |
146 | .open = asl_open, | 146 | .open = asl_open, |
147 | .read = seq_read, | 147 | .read = seq_read, |
148 | .llseek = seq_lseek, | 148 | .llseek = seq_lseek, |
@@ -150,7 +150,7 @@ static struct file_operations asl_fops = { | |||
150 | .owner = THIS_MODULE, | 150 | .owner = THIS_MODULE, |
151 | }; | 151 | }; |
152 | 152 | ||
153 | static struct file_operations pzl_fops = { | 153 | static const struct file_operations pzl_fops = { |
154 | .open = pzl_open, | 154 | .open = pzl_open, |
155 | .read = seq_read, | 155 | .read = seq_read, |
156 | .llseek = seq_lseek, | 156 | .llseek = seq_lseek, |
diff --git a/drivers/usb/host/whci/pzl.c b/drivers/usb/host/whci/pzl.c index a9e05bac6646..0db3fb2dc03a 100644 --- a/drivers/usb/host/whci/pzl.c +++ b/drivers/usb/host/whci/pzl.c | |||
@@ -121,6 +121,10 @@ static enum whc_update pzl_process_qset(struct whc *whc, struct whc_qset *qset) | |||
121 | if (status & QTD_STS_HALTED) { | 121 | if (status & QTD_STS_HALTED) { |
122 | /* Ug, an error. */ | 122 | /* Ug, an error. */ |
123 | process_halted_qtd(whc, qset, td); | 123 | process_halted_qtd(whc, qset, td); |
124 | /* A halted qTD always triggers an update | ||
125 | because the qset was either removed or | ||
126 | reactivated. */ | ||
127 | update |= WHC_UPDATE_UPDATED; | ||
124 | goto done; | 128 | goto done; |
125 | } | 129 | } |
126 | 130 | ||
@@ -333,6 +337,7 @@ int pzl_urb_dequeue(struct whc *whc, struct urb *urb, int status) | |||
333 | struct whc_urb *wurb = urb->hcpriv; | 337 | struct whc_urb *wurb = urb->hcpriv; |
334 | struct whc_qset *qset = wurb->qset; | 338 | struct whc_qset *qset = wurb->qset; |
335 | struct whc_std *std, *t; | 339 | struct whc_std *std, *t; |
340 | bool has_qtd = false; | ||
336 | int ret; | 341 | int ret; |
337 | unsigned long flags; | 342 | unsigned long flags; |
338 | 343 | ||
@@ -343,17 +348,22 @@ int pzl_urb_dequeue(struct whc *whc, struct urb *urb, int status) | |||
343 | goto out; | 348 | goto out; |
344 | 349 | ||
345 | list_for_each_entry_safe(std, t, &qset->stds, list_node) { | 350 | list_for_each_entry_safe(std, t, &qset->stds, list_node) { |
346 | if (std->urb == urb) | 351 | if (std->urb == urb) { |
352 | if (std->qtd) | ||
353 | has_qtd = true; | ||
347 | qset_free_std(whc, std); | 354 | qset_free_std(whc, std); |
348 | else | 355 | } else |
349 | std->qtd = NULL; /* so this std is re-added when the qset is */ | 356 | std->qtd = NULL; /* so this std is re-added when the qset is */ |
350 | } | 357 | } |
351 | 358 | ||
352 | pzl_qset_remove(whc, qset); | 359 | if (has_qtd) { |
353 | wurb->status = status; | 360 | pzl_qset_remove(whc, qset); |
354 | wurb->is_async = false; | 361 | update_pzl_hw_view(whc); |
355 | queue_work(whc->workqueue, &wurb->dequeue_work); | 362 | wurb->status = status; |
356 | 363 | wurb->is_async = false; | |
364 | queue_work(whc->workqueue, &wurb->dequeue_work); | ||
365 | } else | ||
366 | qset_remove_urb(whc, qset, urb, status); | ||
357 | out: | 367 | out: |
358 | spin_unlock_irqrestore(&whc->lock, flags); | 368 | spin_unlock_irqrestore(&whc->lock, flags); |
359 | 369 | ||