On Wed, Sep 15, 2004 at 01:07:55PM -0700, Greg KH wrote:
> On Wed, Sep 15, 2004 at 11:56:24AM -0700, Greg KH wrote:
> > Hi,
> > 
> > I've just applied the patch below to try to clean up the USB host
> > controller driver warnings that sparse spits out about __iomem usages
> > being incorrect.
> > 
> > However it looks like you all are just taking a memory section that was
> > allocated in ioremap() and using that to get values to call readX() and
> > friends on.  The compiler really doesn't like this now :)
> > 
> > Care to send patches to fix this all up?
> 
> Ah, nevermind.  See the lkml thread about __iomem for where I was
> confused.  I'll go fix up the hcd drivers now...

And here's the patch I just did for the ehci driver, I'll clean up ohci
in the same manner.

thanks,

greg k-h


USB: fix up __iomem warnings in the ehci driver.

Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>

diff -Nru a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
--- a/drivers/usb/host/ehci-hcd.c       2004-09-15 13:06:05 -07:00
+++ b/drivers/usb/host/ehci-hcd.c       2004-09-15 13:06:05 -07:00
@@ -155,7 +155,7 @@
  * before driver shutdown. But it also seems to be caused by bugs in cardbus
  * bridge shutdown:  shutting down the bridge before the devices using it.
  */
-static int handshake (u32 *ptr, u32 mask, u32 done, int usec)
+static int handshake (void __iomem *ptr, u32 mask, u32 done, int usec)
 {
        u32     result;
 
@@ -340,9 +340,8 @@
 
        spin_lock_init (&ehci->lock);
 
-       ehci->caps = (struct ehci_caps *) hcd->regs;
-       ehci->regs = (struct ehci_regs *) (hcd->regs + 
-                               HC_LENGTH (readl (&ehci->caps->hc_capbase)));
+       ehci->caps = hcd->regs;
+       ehci->regs = hcd->regs + HC_LENGTH (readl (&ehci->caps->hc_capbase));
        dbg_hcs_params (ehci, "reset");
        dbg_hcc_params (ehci, "reset");
 
diff -Nru a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h
--- a/drivers/usb/host/ehci.h   2004-09-15 13:06:05 -07:00
+++ b/drivers/usb/host/ehci.h   2004-09-15 13:06:05 -07:00
@@ -71,8 +71,8 @@
 
        /* glue to PCI and HCD framework */
        struct usb_hcd          hcd;
-       struct ehci_caps        *caps;
-       struct ehci_regs        *regs;
+       struct ehci_caps __iomem *caps;
+       struct ehci_regs __iomem *regs;
        u32                     hcs_params;     /* cached register copy */
 
        /* per-HC memory pools (could be per-bus, but ...) */


-------------------------------------------------------
This SF.Net email is sponsored by: thawte's Crypto Challenge Vl
Crack the code and win a Sony DCRHC40 MiniDV Digital Handycam
Camcorder. More prizes in the weekly Lunch Hour Challenge.
Sign up NOW http://ad.doubleclick.net/clk;10740251;10262165;m
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to