From
818dc8ebd261cdc59670fe1580248ad47f18a1de Mon Sep 17 00:00:00 2001
From: Felipe Balbi <felipe.balbi@nokia.com>
Date: Fri, 12 Sep 2008 21:07:09 +0300
Subject: [PATCH] omap: usb: ehci: fix usb of hcd->regs
hcd->regs should be initialized by ioremaping hcd->rsrc_start and
hcd->rsrc_len. Fix it for ehci-omap.c.
Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
hcd->rsrc_start = dev->resource[0].start;
hcd->rsrc_len = dev->resource[0].end - dev->resource[0].start + 1;
- hcd->regs = (void __iomem *) (int) IO_ADDRESS(hcd->rsrc_start);
+ hcd->regs = ioremap(hcd->rsrc_start, hcd->rsrc_len);
+ if (!hcd->regs) {
+ dev_err(&dev->dev, "ioremap failed\n");
+ return -ENOMEM;
+ }
ehci = hcd_to_ehci(hcd);
ehci->caps = hcd->regs;
dev_dbg(hcd->self.controller, "ERR: add_hcd");
omap_stop_ehc(dev, hcd);
-
+ iounmap(hcd->regs);
usb_put_hcd(hcd);
+
return retval;
}
dev_dbg(&dev->dev, "ehci_hcd_omap_drv_remove()");
+ iounmap(hcd->regs);
usb_remove_hcd(hcd);
usb_put_hcd(hcd);
omap_stop_ehc(dev, hcd);