Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 208062
b: refs/heads/master
c: 31ee04d
h: refs/heads/master
v: v3
  • Loading branch information
Marek Szyprowski authored and Greg Kroah-Hartman committed Aug 10, 2010
1 parent b210c9a commit e62f683
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 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: 1eb838d3e2a473acbb9b21278e75b79640fb2c7b
refs/heads/master: 31ee04de7e670de4199572595cce4aaa7f7f6351
20 changes: 17 additions & 3 deletions trunk/drivers/usb/gadget/s3c-hsotg.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ struct s3c_hsotg {
void __iomem *regs;
struct resource *regs_res;
int irq;
struct clk *clk;

unsigned int dedicated_fifos:1;

Expand Down Expand Up @@ -3258,21 +3259,28 @@ static int __devinit s3c_hsotg_probe(struct platform_device *pdev)
hsotg->dev = dev;
hsotg->plat = plat;

hsotg->clk = clk_get(&pdev->dev, "otg");
if (IS_ERR(hsotg->clk)) {
dev_err(dev, "cannot get otg clock\n");
ret = -EINVAL;
goto err_mem;
}

platform_set_drvdata(pdev, hsotg);

res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
dev_err(dev, "cannot find register resource 0\n");
ret = -EINVAL;
goto err_mem;
goto err_clk;
}

hsotg->regs_res = request_mem_region(res->start, resource_size(res),
dev_name(dev));
if (!hsotg->regs_res) {
dev_err(dev, "cannot reserve registers\n");
ret = -ENOENT;
goto err_mem;
goto err_clk;
}

hsotg->regs = ioremap(res->start, resource_size(res));
Expand Down Expand Up @@ -3325,6 +3333,8 @@ static int __devinit s3c_hsotg_probe(struct platform_device *pdev)

/* reset the system */

clk_enable(hsotg->clk);

s3c_hsotg_gate(pdev, true);

s3c_hsotg_otgreset(hsotg);
Expand All @@ -3348,7 +3358,8 @@ static int __devinit s3c_hsotg_probe(struct platform_device *pdev)
err_regs_res:
release_resource(hsotg->regs_res);
kfree(hsotg->regs_res);

err_clk:
clk_put(hsotg->clk);
err_mem:
kfree(hsotg);
return ret;
Expand All @@ -3370,6 +3381,9 @@ static int __devexit s3c_hsotg_remove(struct platform_device *pdev)

s3c_hsotg_gate(pdev, false);

clk_disable(hsotg->clk);
clk_put(hsotg->clk);

kfree(hsotg);
return 0;
}
Expand Down

0 comments on commit e62f683

Please sign in to comment.