Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 280822
b: refs/heads/master
c: 5ddcee2
h: refs/heads/master
v: v3
  • Loading branch information
Felipe Balbi committed Dec 12, 2011
1 parent 738a957 commit ce9b7f0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 10 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: 8300dd236e957429acfb36be0ce8fe276dbe823c
refs/heads/master: 5ddcee27c19e36711992a0e6ed3249fd06faa0e7
28 changes: 19 additions & 9 deletions trunk/drivers/usb/dwc3/dwc3-omap.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
#include <linux/io.h>
#include <linux/module.h>

#include "core.h"
#include "io.h"

/*
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -236,16 +238,20 @@ static int __devinit dwc3_omap_probe(struct platform_device *pdev)
goto err1;
}

dwc3 = platform_device_alloc("dwc3", -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);
Expand Down Expand Up @@ -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 */
Expand All @@ -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);

Expand All @@ -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);

Expand Down

0 comments on commit ce9b7f0

Please sign in to comment.