summaryrefslogtreecommitdiff
path: root/drivers/staging/dwc2/hcd.h
diff options
context:
space:
mode:
authorPaul Zimmerman <Paul.Zimmerman@synopsys.com>2013-07-13 21:53:48 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-07-23 21:54:48 (GMT)
commit0d012b98662495f1fe5c4aa8acc7e6ed121c1254 (patch)
tree392e19e0ff6f7001546f7f9d398a98f3c8c6fa59 /drivers/staging/dwc2/hcd.h
parente842b976a88a39b447fc34bd0fcb3c0be0a1d9d9 (diff)
downloadlinux-fsl-qoriq-0d012b98662495f1fe5c4aa8acc7e6ed121c1254.tar.xz
staging: dwc2: refactor dwc2_host_complete()
The parameters to dwc2_host_complete() didn't make much sense. The 'context' parameter always came from the ->priv member of the 'dwc2_urb' parameter, and both of those always came from a struct dwc2_qtd. So just pass in the struct dwc2_qtd instead. This also allows us to null out the dwc2_qtd->urb member after it is freed, which the calling code forgot to do in several places, causing random driver crashes from dereferencing the freed pointer. This also requires the calls to dwc2_hc_handle_tt_clear() to be moved before the calls to dwc2_host_complete(), otherwise that routine would do nothing because dwc2_qtd->urb has already been freed. Signed-off-by: Paul Zimmerman <paulz@synopsys.com> Tested-by: Stephen Warren <swarren@wwwdotorg.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/dwc2/hcd.h')
-rw-r--r--drivers/staging/dwc2/hcd.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/dwc2/hcd.h b/drivers/staging/dwc2/hcd.h
index cf6c055..933e8d1 100644
--- a/drivers/staging/dwc2/hcd.h
+++ b/drivers/staging/dwc2/hcd.h
@@ -716,8 +716,8 @@ extern void dwc2_host_disconnect(struct dwc2_hsotg *hsotg);
extern void dwc2_host_hub_info(struct dwc2_hsotg *hsotg, void *context,
int *hub_addr, int *hub_port);
extern int dwc2_host_get_speed(struct dwc2_hsotg *hsotg, void *context);
-extern void dwc2_host_complete(struct dwc2_hsotg *hsotg, void *context,
- struct dwc2_hcd_urb *dwc2_urb, int status);
+extern void dwc2_host_complete(struct dwc2_hsotg *hsotg, struct dwc2_qtd *qtd,
+ int status);
#ifdef DEBUG
/*