diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-09 12:09:47 -0800 | 
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-09 12:09:47 -0800 | 
| commit | 55b81e6f2795484ea8edf5805c95c007cacfa736 (patch) | |
| tree | c3724975107857fcc03b5dd649c462e4f72397be /drivers/usb/dwc3/dwc3-omap.c | |
| parent | 5983faf942f260023e547f3c5f38c1033c35cc9b (diff) | |
| parent | 08e87d0d773dc9ca5faf4c3306e238ed0ea129b0 (diff) | |
| download | olio-linux-3.10-55b81e6f2795484ea8edf5805c95c007cacfa736.tar.xz olio-linux-3.10-55b81e6f2795484ea8edf5805c95c007cacfa736.zip  | |
Merge branch 'usb-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
* 'usb-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (232 commits)
  USB: Add USB-ID for Multiplex RC serial adapter to cp210x.c
  xhci: Clean up 32-bit build warnings.
  USB: update documentation for usbmon
  usb: usb-storage doesn't support dynamic id currently, the patch disables the feature to fix an oops
  drivers/usb/class/cdc-acm.c: clear dangling pointer
  drivers/usb/dwc3/dwc3-pci.c: introduce missing kfree
  drivers/usb/host/isp1760-if.c: introduce missing kfree
  usb: option: add ZD Incorporated HSPA modem
  usb: ch9: fix up MaxStreams helper
  USB: usb-skeleton.c: cleanup open_count
  USB: usb-skeleton.c: fix open/disconnect race
  xhci: Properly handle COMP_2ND_BW_ERR
  USB: remove dead code from suspend/resume path
  USB: add quirk for another camera
  drivers: usb: wusbcore: Fix dependency for USB_WUSB
  xhci: Better debugging for critical host errors.
  xhci: Be less verbose during URB cancellation.
  xhci: Remove debugging about ring structure allocation.
  xhci: Remove debugging about toggling cycle bits.
  xhci: Remove debugging for individual transfers.
  ...
Diffstat (limited to 'drivers/usb/dwc3/dwc3-omap.c')
| -rw-r--r-- | drivers/usb/dwc3/dwc3-omap.c | 43 | 
1 files changed, 22 insertions, 21 deletions
diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c index 062552b5fc8..3274ac8f120 100644 --- a/drivers/usb/dwc3/dwc3-omap.c +++ b/drivers/usb/dwc3/dwc3-omap.c @@ -48,6 +48,7 @@  #include <linux/io.h>  #include <linux/module.h> +#include "core.h"  #include "io.h"  /* @@ -200,6 +201,7 @@ static int __devinit dwc3_omap_probe(struct platform_device *pdev)  	struct dwc3_omap	*omap;  	struct resource		*res; +	int			devid;  	int			ret = -ENOMEM;  	int			irq; @@ -236,16 +238,20 @@ static int __devinit dwc3_omap_probe(struct platform_device *pdev)  		goto err1;  	} -	dwc3 = platform_device_alloc("dwc3-omap", -1); +	devid = dwc3_get_device_id(); +	if (devid < 0) +		goto err2; + +	dwc3 = platform_device_alloc("dwc3", devid);  	if (!dwc3) {  		dev_err(&pdev->dev, "couldn't allocate dwc3 device\n"); -		goto err2; +		goto err3;  	}  	context = kzalloc(resource_size(res), GFP_KERNEL);  	if (!context) {  		dev_err(&pdev->dev, "couldn't allocate dwc3 context memory\n"); -		goto err3; +		goto err4;  	}  	spin_lock_init(&omap->lock); @@ -299,7 +305,7 @@ static int __devinit dwc3_omap_probe(struct platform_device *pdev)  	if (ret) {  		dev_err(&pdev->dev, "failed to request IRQ #%d --> %d\n",  				omap->irq, ret); -		goto err4; +		goto err5;  	}  	/* enable all IRQs */ @@ -322,26 +328,29 @@ static int __devinit dwc3_omap_probe(struct platform_device *pdev)  			pdev->num_resources);  	if (ret) {  		dev_err(&pdev->dev, "couldn't add resources to dwc3 device\n"); -		goto err5; +		goto err6;  	}  	ret = platform_device_add(dwc3);  	if (ret) {  		dev_err(&pdev->dev, "failed to register dwc3 device\n"); -		goto err5; +		goto err6;  	}  	return 0; -err5: +err6:  	free_irq(omap->irq, omap); -err4: +err5:  	kfree(omap->context); -err3: +err4:  	platform_device_put(dwc3); +err3: +	dwc3_put_device_id(devid); +  err2:  	iounmap(base); @@ -358,6 +367,7 @@ static int __devexit dwc3_omap_remove(struct platform_device *pdev)  	platform_device_unregister(omap->dwc3); +	dwc3_put_device_id(omap->dwc3->id);  	free_irq(omap->irq, omap);  	iounmap(omap->base); @@ -384,18 +394,9 @@ static struct platform_driver dwc3_omap_driver = {  	},  }; +module_platform_driver(dwc3_omap_driver); + +MODULE_ALIAS("platform:omap-dwc3");  MODULE_AUTHOR("Felipe Balbi <balbi@ti.com>");  MODULE_LICENSE("Dual BSD/GPL");  MODULE_DESCRIPTION("DesignWare USB3 OMAP Glue Layer"); - -static int __devinit dwc3_omap_init(void) -{ -	return platform_driver_register(&dwc3_omap_driver); -} -module_init(dwc3_omap_init); - -static void __exit dwc3_omap_exit(void) -{ -	platform_driver_unregister(&dwc3_omap_driver); -} -module_exit(dwc3_omap_exit);  |