Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 316984
b: refs/heads/master
c: 390a0a7
h: refs/heads/master
v: v3
  • Loading branch information
Jingoo Han authored and Greg Kroah-Hartman committed Jul 6, 2012
1 parent b8168c9 commit b6adbb3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 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: e864abed546f9f4b76a3580fb3c53cd389e0c015
refs/heads/master: 390a0a78067c487609ba5bd18c264f7d5b6f4e96
19 changes: 6 additions & 13 deletions trunk/drivers/usb/host/ohci-exynos.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ static int __devinit exynos_ohci_probe(struct platform_device *pdev)
return -EINVAL;
}

exynos_ohci = kzalloc(sizeof(struct exynos_ohci_hcd), GFP_KERNEL);
exynos_ohci = devm_kzalloc(&pdev->dev, sizeof(struct exynos_ohci_hcd),
GFP_KERNEL);
if (!exynos_ohci)
return -ENOMEM;

Expand All @@ -97,8 +98,7 @@ static int __devinit exynos_ohci_probe(struct platform_device *pdev)
dev_name(&pdev->dev));
if (!hcd) {
dev_err(&pdev->dev, "Unable to create HCD\n");
err = -ENOMEM;
goto fail_hcd;
return -ENOMEM;
}

exynos_ohci->hcd = hcd;
Expand All @@ -123,7 +123,7 @@ static int __devinit exynos_ohci_probe(struct platform_device *pdev)

hcd->rsrc_start = res->start;
hcd->rsrc_len = resource_size(res);
hcd->regs = ioremap(res->start, resource_size(res));
hcd->regs = devm_ioremap(&pdev->dev, res->start, hcd->rsrc_len);
if (!hcd->regs) {
dev_err(&pdev->dev, "Failed to remap I/O memory\n");
err = -ENOMEM;
Expand All @@ -134,7 +134,7 @@ static int __devinit exynos_ohci_probe(struct platform_device *pdev)
if (!irq) {
dev_err(&pdev->dev, "Failed to get IRQ\n");
err = -ENODEV;
goto fail;
goto fail_io;
}

if (pdata->phy_init)
Expand All @@ -146,23 +146,19 @@ static int __devinit exynos_ohci_probe(struct platform_device *pdev)
err = usb_add_hcd(hcd, irq, IRQF_SHARED);
if (err) {
dev_err(&pdev->dev, "Failed to add USB HCD\n");
goto fail;
goto fail_io;
}

platform_set_drvdata(pdev, exynos_ohci);

return 0;

fail:
iounmap(hcd->regs);
fail_io:
clk_disable(exynos_ohci->clk);
fail_clken:
clk_put(exynos_ohci->clk);
fail_clk:
usb_put_hcd(hcd);
fail_hcd:
kfree(exynos_ohci);
return err;
}

Expand All @@ -177,13 +173,10 @@ static int __devexit exynos_ohci_remove(struct platform_device *pdev)
if (pdata && pdata->phy_exit)
pdata->phy_exit(pdev, S5P_USB_PHY_HOST);

iounmap(hcd->regs);

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

usb_put_hcd(hcd);
kfree(exynos_ohci);

return 0;
}
Expand Down

0 comments on commit b6adbb3

Please sign in to comment.