xhci: rework cycle bit checking for new dequeue pointers
[deliverable/linux.git] / drivers / usb / host / ohci-ppc-of.c
index 81f3eba215c1224e3b7d1da64c7d1d31f12dfb15..965e3e9e688ad85a713c51b43c2a69276ee0d22b 100644 (file)
@@ -115,24 +115,18 @@ static int ohci_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;
+       hcd->regs = devm_ioremap_resource(&op->dev, &res);
+       if (IS_ERR(hcd->regs)) {
+               rv = PTR_ERR(hcd->regs);
                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__);
+               dev_err(&op->dev, "%s: irq_of_parse_and_map failed\n",
+                       __FILE__);
                rv = -EBUSY;
-               goto err_irq;
-       }
-
-       hcd->regs = ioremap(hcd->rsrc_start, hcd->rsrc_len);
-       if (!hcd->regs) {
-               printk(KERN_ERR "%s: ioremap failed\n", __FILE__);
-               rv = -ENOMEM;
-               goto err_ioremap;
+               goto err_rmr;
        }
 
        ohci = hcd_to_ohci(hcd);
@@ -147,8 +141,10 @@ static int ohci_hcd_ppc_of_probe(struct platform_device *op)
        ohci_hcd_init(ohci);
 
        rv = usb_add_hcd(hcd, irq, 0);
-       if (rv == 0)
+       if (rv == 0) {
+               device_wakeup_enable(hcd->self.controller);
                return 0;
+       }
 
        /* by now, 440epx is known to show usb_23 erratum */
        np = of_find_compatible_node(NULL, NULL, "ibm,usb-ehci-440epx");
@@ -174,11 +170,7 @@ static int ohci_hcd_ppc_of_probe(struct platform_device *op)
                        pr_debug("%s: cannot get ehci offset from fdt\n", __FILE__);
        }
 
-       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);
 
@@ -193,9 +185,7 @@ static int ohci_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);
 
        usb_put_hcd(hcd);
 
This page took 0.024388 seconds and 5 git commands to generate.