Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 325810
b: refs/heads/master
c: 1c5404f
h: refs/heads/master
v: v3
  • Loading branch information
Julia Lawall authored and Greg Kroah-Hartman committed Aug 10, 2012
1 parent 139fc9f commit 5867fce
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 22 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: af09c060895b9c9137c02943c71302ac0fc9555a
refs/heads/master: 1c5404f7abd250ce71849c2687d266073b54e1d4
28 changes: 7 additions & 21 deletions trunk/drivers/usb/host/ehci-ppc-of.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,22 +114,16 @@ static int __devinit ehci_hcd_ppc_of_probe(struct platform_device *op)
hcd->rsrc_start = res.start;
hcd->rsrc_len = resource_size(&res);

if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, hcd_name)) {
printk(KERN_ERR "%s: request_mem_region failed\n", __FILE__);
rv = -EBUSY;
goto err_rmr;
}

irq = irq_of_parse_and_map(dn, 0);
if (irq == NO_IRQ) {
printk(KERN_ERR "%s: irq_of_parse_and_map failed\n", __FILE__);
rv = -EBUSY;
goto err_irq;
}

hcd->regs = ioremap(hcd->rsrc_start, hcd->rsrc_len);
hcd->regs = devm_request_and_ioremap(&op->dev, &res);
if (!hcd->regs) {
printk(KERN_ERR "%s: ioremap failed\n", __FILE__);
pr_err("%s: devm_request_and_ioremap failed\n", __FILE__);
rv = -ENOMEM;
goto err_ioremap;
}
Expand All @@ -139,8 +133,10 @@ static int __devinit ehci_hcd_ppc_of_probe(struct platform_device *op)
if (np != NULL) {
/* claim we really affected by usb23 erratum */
if (!of_address_to_resource(np, 0, &res))
ehci->ohci_hcctrl_reg = ioremap(res.start +
OHCI_HCCTRL_OFFSET, OHCI_HCCTRL_LEN);
ehci->ohci_hcctrl_reg =
devm_ioremap(&op->dev,
res.start + OHCI_HCCTRL_OFFSET,
OHCI_HCCTRL_LEN);
else
pr_debug("%s: no ohci offset in fdt\n", __FILE__);
if (!ehci->ohci_hcctrl_reg) {
Expand Down Expand Up @@ -169,19 +165,13 @@ static int __devinit ehci_hcd_ppc_of_probe(struct platform_device *op)

rv = usb_add_hcd(hcd, irq, 0);
if (rv)
goto err_ehci;
goto err_ioremap;

return 0;

err_ehci:
if (ehci->has_amcc_usb23)
iounmap(ehci->ohci_hcctrl_reg);
iounmap(hcd->regs);
err_ioremap:
irq_dispose_mapping(irq);
err_irq:
release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
err_rmr:
usb_put_hcd(hcd);

return rv;
Expand All @@ -202,9 +192,7 @@ static int ehci_hcd_ppc_of_remove(struct platform_device *op)

usb_remove_hcd(hcd);

iounmap(hcd->regs);
irq_dispose_mapping(hcd->irq);
release_mem_region(hcd->rsrc_start, hcd->rsrc_len);

/* use request_mem_region to test if the ohci driver is loaded. if so
* ensure the ohci core is operational.
Expand All @@ -222,8 +210,6 @@ static int ehci_hcd_ppc_of_remove(struct platform_device *op)
pr_debug("%s: no ohci offset in fdt\n", __FILE__);
of_node_put(np);
}

iounmap(ehci->ohci_hcctrl_reg);
}
usb_put_hcd(hcd);

Expand Down

0 comments on commit 5867fce

Please sign in to comment.