Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 316985
b: refs/heads/master
c: 9cb0756
h: refs/heads/master
i:
  316983: b8168c9
v: v3
  • Loading branch information
Jingoo Han authored and Greg Kroah-Hartman committed Jul 6, 2012
1 parent b6adbb3 commit dbf6944
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: 390a0a78067c487609ba5bd18c264f7d5b6f4e96
refs/heads/master: 9cb07563721cb05f91b517aefd70b57ba8a1d5aa
19 changes: 6 additions & 13 deletions trunk/drivers/usb/host/ehci-s5p.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ static int __devinit s5p_ehci_probe(struct platform_device *pdev)
return -EINVAL;
}

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

Expand All @@ -89,8 +90,7 @@ static int __devinit s5p_ehci_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;
}

s5p_ehci->hcd = hcd;
Expand All @@ -115,7 +115,7 @@ static int __devinit s5p_ehci_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 @@ -126,7 +126,7 @@ static int __devinit s5p_ehci_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 @@ -151,23 +151,19 @@ static int __devinit s5p_ehci_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, s5p_ehci);

return 0;

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

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

iounmap(hcd->regs);

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

usb_put_hcd(hcd);
kfree(s5p_ehci);

return 0;
}
Expand Down

0 comments on commit dbf6944

Please sign in to comment.