Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 363757
b: refs/heads/master
c: ba0e60d
h: refs/heads/master
i:
  363755: 41dc413
v: v3
  • Loading branch information
Paul Zimmerman authored and Greg Kroah-Hartman committed Mar 26, 2013
1 parent 4ef6db2 commit 43493c5
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e62662c7f3079e02a1e59229901648758a49464a
refs/heads/master: ba0e60d18c5940ed6e9c58e61b7747e7170b6fbb
46 changes: 29 additions & 17 deletions trunk/drivers/staging/dwc2/hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2707,16 +2707,6 @@ int dwc2_hcd_init(struct dwc2_hsotg *hsotg, int irq,
goto error1;
}

hcd = usb_create_hcd(&dwc2_hc_driver, hsotg->dev, dev_name(hsotg->dev));
if (!hcd)
goto error1;

hcd->has_tt = 1;

spin_lock_init(&hsotg->lock);
((struct wrapper_priv_data *) &hcd->hcd_priv)->hsotg = hsotg;
hsotg->priv = hcd;

/*
* Store the contents of the hardware configuration registers here for
* easy access later
Expand Down Expand Up @@ -2775,25 +2765,48 @@ int dwc2_hcd_init(struct dwc2_hsotg *hsotg, int irq,
hsotg->frame_num_array = kzalloc(sizeof(*hsotg->frame_num_array) *
FRAME_NUM_ARRAY_SIZE, GFP_KERNEL);
if (!hsotg->frame_num_array)
goto error2;
goto error1;
hsotg->last_frame_num_array = kzalloc(
sizeof(*hsotg->last_frame_num_array) *
FRAME_NUM_ARRAY_SIZE, GFP_KERNEL);
if (!hsotg->last_frame_num_array)
goto error2;
goto error1;
hsotg->last_frame_num = HFNUM_MAX_FRNUM;
#endif

hsotg->core_params = kzalloc(sizeof(*hsotg->core_params), GFP_KERNEL);
if (!hsotg->core_params)
goto error2;
goto error1;

dwc2_set_uninitialized((int *)hsotg->core_params,
sizeof(*hsotg->core_params) / sizeof(int));

/* Validate parameter values */
dwc2_set_parameters(hsotg, params);

/* Set device flags indicating whether the HCD supports DMA */
if (hsotg->core_params->dma_enable > 0) {
if (dma_set_mask(hsotg->dev, DMA_BIT_MASK(31)) < 0)
dev_warn(hsotg->dev,
"can't enable workaround for >2GB RAM\n");
if (dma_set_coherent_mask(hsotg->dev, DMA_BIT_MASK(31)) < 0)
dev_warn(hsotg->dev,
"can't enable workaround for >2GB RAM\n");
} else {
dma_set_mask(hsotg->dev, 0);
dma_set_coherent_mask(hsotg->dev, 0);
}

hcd = usb_create_hcd(&dwc2_hc_driver, hsotg->dev, dev_name(hsotg->dev));
if (!hcd)
goto error1;

hcd->has_tt = 1;

spin_lock_init(&hsotg->lock);
((struct wrapper_priv_data *) &hcd->hcd_priv)->hsotg = hsotg;
hsotg->priv = hcd;

/* Initialize the DWC_otg core, and select the Phy type */
retval = dwc2_core_init(hsotg, true);
if (retval)
Expand Down Expand Up @@ -2903,15 +2916,15 @@ int dwc2_hcd_init(struct dwc2_hsotg *hsotg, int irq,
error3:
dwc2_hcd_release(hsotg);
error2:
usb_put_hcd(hcd);
error1:
kfree(hsotg->core_params);

#ifdef CONFIG_USB_DWC2_TRACK_MISSED_SOFS
kfree(hsotg->last_frame_num_array);
kfree(hsotg->frame_num_array);
#endif

usb_put_hcd(hcd);
error1:
dev_err(hsotg->dev, "%s() FAILED, returning %d\n", __func__, retval);
return retval;
}
Expand Down Expand Up @@ -2939,12 +2952,11 @@ void dwc2_hcd_remove(struct dwc2_hsotg *hsotg)
usb_remove_hcd(hcd);
hsotg->priv = NULL;
dwc2_hcd_release(hsotg);
usb_put_hcd(hcd);

#ifdef CONFIG_USB_DWC2_TRACK_MISSED_SOFS
kfree(hsotg->last_frame_num_array);
kfree(hsotg->frame_num_array);
#endif

usb_put_hcd(hcd);
}
EXPORT_SYMBOL_GPL(dwc2_hcd_remove);
12 changes: 0 additions & 12 deletions trunk/drivers/staging/dwc2/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,18 +146,6 @@ static int dwc2_driver_probe(struct pci_dev *dev,

pci_set_master(dev);

if (dwc2_module_params.dma_enable > 0) {
if (pci_set_dma_mask(dev, DMA_BIT_MASK(31)) < 0)
dev_warn(&dev->dev,
"can't enable workaround for >2GB RAM\n");
if (pci_set_consistent_dma_mask(dev, DMA_BIT_MASK(31)) < 0)
dev_warn(&dev->dev,
"can't enable workaround for >2GB RAM\n");
} else {
pci_set_dma_mask(dev, 0);
pci_set_consistent_dma_mask(dev, 0);
}

retval = dwc2_hcd_init(hsotg, dev->irq, &dwc2_module_params);
if (retval) {
pci_disable_device(dev);
Expand Down

0 comments on commit 43493c5

Please sign in to comment.