diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2012-06-22 12:56:40 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2012-06-30 22:34:54 +0200 |
commit | 3af2266149c8e39c4e091b98f3322b913c3e6342 (patch) | |
tree | 296a61e8c3fe18cb24296d8d17afde8af1c41c63 /drivers | |
parent | a3d643a7f14e8a3e2f56801049e6a00bd3814106 (diff) | |
download | barebox-3af2266149c8e39c4e091b98f3322b913c3e6342.tar.gz barebox-3af2266149c8e39c4e091b98f3322b913c3e6342.tar.xz |
USB ohci: Fix sparse warnings
- put registers into iomem space
- do not use 0 as NULL pointer
- use dev_request_mem_region()
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/host/ohci-hcd.c | 40 | ||||
-rw-r--r-- | drivers/usb/host/ohci.h | 2 |
2 files changed, 8 insertions, 34 deletions
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c index 05e4094386..f10d827615 100644 --- a/drivers/usb/host/ohci-hcd.c +++ b/drivers/usb/host/ohci-hcd.c @@ -415,7 +415,7 @@ static void ohci_dump(struct ohci *controller, int verbose) /* get a transfer request */ -int sohci_submit_job(struct urb_priv *urb, struct devrequest *setup) +static int sohci_submit_job(struct urb_priv *urb, struct devrequest *setup) { struct ed *ed; int i, size = 0; @@ -498,7 +498,7 @@ int sohci_submit_job(struct urb_priv *urb, struct devrequest *setup) static inline int sohci_return_job(struct ohci *hc, struct urb_priv *urb) { #ifdef ENBALE_PIPE_INTERRUPT - struct ohci_regs *regs = hc->regs; + struct ohci_regs __iomem *regs = hc->regs; #endif switch (usb_pipetype(urb->pipe)) { @@ -848,7 +848,7 @@ static void td_fill(struct ohci *ohci, unsigned int info, } #endif if (!len) - data = 0; + data = NULL; td->hwINFO = m32_swap(info); td->hwCBP = virt_to_phys((void *)m32_swap((unsigned long)data)); @@ -894,7 +894,7 @@ static void td_submit_job(struct usb_device *dev, unsigned long pipe, if (data_len) data = buffer; else - data = 0; + data = NULL; switch (usb_pipetype(pipe)) { case PIPE_BULK: @@ -1214,32 +1214,6 @@ static inline void wr_rh_portstat(struct ohci *ohci, int wIndex, __u32 value) writel(value, &ohci->regs->roothub.portstatus[wIndex-1]); } -/* request to virtual root hub */ - -int rh_check_port_status(struct ohci *controller) -{ - __u32 temp, ndp, i; - int res; - - res = -1; - temp = roothub_a(controller); - ndp = (temp & RH_A_NDP); -#ifdef CONFIG_AT91C_PQFP_UHPBUG - ndp = (ndp == 2) ? 1 : 0; -#endif - for (i = 0; i < ndp; i++) { - temp = roothub_portstatus(controller, i); - /* check for a device disconnect */ - if (((temp & (RH_PS_PESC | RH_PS_CSC)) == - (RH_PS_PESC | RH_PS_CSC)) && - ((temp & RH_PS_CCS) == 0)) { - res = i; - break; - } - } - return res; -} - static int ohci_submit_rh_msg(struct usb_device *dev, unsigned long pipe, void *buffer, int transfer_len, struct devrequest *cmd) { @@ -1502,7 +1476,7 @@ static int ohci_submit_rh_msg(struct usb_device *dev, unsigned long pipe, /* common code for handling submit messages - used for all but root hub */ /* accesses. */ -int submit_common_msg(struct usb_device *dev, unsigned long pipe, void *buffer, +static int submit_common_msg(struct usb_device *dev, unsigned long pipe, void *buffer, int transfer_len, struct devrequest *setup, int interval, int timeout) { @@ -1721,7 +1695,7 @@ static int hc_start(struct ohci *ohci) static int hc_interrupt(struct ohci *ohci) { - struct ohci_regs *regs = ohci->regs; + struct ohci_regs __iomem *regs = ohci->regs; int ints; int stat = 0; @@ -1840,7 +1814,7 @@ static int ohci_probe(struct device_d *dev) usb_register_host(host); - ohci->regs = (void *)dev->resource[0].start; + ohci->regs = dev_request_mem_region(dev, 0); return 0; } diff --git a/drivers/usb/host/ohci.h b/drivers/usb/host/ohci.h index 913296319e..9c9b8375ce 100644 --- a/drivers/usb/host/ohci.h +++ b/drivers/usb/host/ohci.h @@ -408,7 +408,7 @@ struct ohci { int disabled; /* e.g. got a UE, we're hung */ unsigned long flags; /* for HC bugs */ - struct ohci_regs *regs; /* OHCI controller's memory */ + struct ohci_regs __iomem *regs; /* OHCI controller's memory */ int ohci_int_load[32]; /* load of the 32 Interrupt Chains (for load balancing)*/ struct ed *ed_rm_list[2]; /* lists of all endpoints to be removed */ |