aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/xhci-mem.c
diff options
context:
space:
mode:
authorXenia Ragiadakou <burzalodowa@gmail.com>2013-11-14 22:34:06 -0500
committerSarah Sharp <sarah.a.sharp@linux.intel.com>2013-12-02 15:59:48 -0500
commitb0ba9720846c980d053b1ffcd766fddfbef95d4c (patch)
tree03c170ac268064f2aeb07d37e13c37deee938c8d /drivers/usb/host/xhci-mem.c
parent2a100047481a5c7430c72883b586eb6f2df34812 (diff)
xhci: replace xhci_readl() with readl()
Function xhci_readl() is used to read 32bit xHC registers residing in MMIO address space. It takes as first argument a pointer to the xhci_hcd although it does not use it. xhci_readl() internally simply calls readl(). This creates an illusion that xhci_readl() is an xhci specific function that has to be called in a context where a pointer to xhci_hcd is available. Remove the unnecessary xhci_readl() wrapper function and replace its calls to with calls to readl() to make the code more straightforward. Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Diffstat (limited to 'drivers/usb/host/xhci-mem.c')
-rw-r--r--drivers/usb/host/xhci-mem.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
index 99e7251c2b65..3682a3b7e057 100644
--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -1986,7 +1986,7 @@ static void xhci_add_in_port(struct xhci_hcd *xhci, unsigned int num_ports,
1986 } 1986 }
1987 1987
1988 /* Port offset and count in the third dword, see section 7.2 */ 1988 /* Port offset and count in the third dword, see section 7.2 */
1989 temp = xhci_readl(xhci, addr + 2); 1989 temp = readl(addr + 2);
1990 port_offset = XHCI_EXT_PORT_OFF(temp); 1990 port_offset = XHCI_EXT_PORT_OFF(temp);
1991 port_count = XHCI_EXT_PORT_COUNT(temp); 1991 port_count = XHCI_EXT_PORT_COUNT(temp);
1992 xhci_dbg_trace(xhci, trace_xhci_dbg_init, 1992 xhci_dbg_trace(xhci, trace_xhci_dbg_init,
@@ -2069,7 +2069,7 @@ static int xhci_setup_port_arrays(struct xhci_hcd *xhci, gfp_t flags)
2069 int cap_count = 0; 2069 int cap_count = 0;
2070 2070
2071 addr = &xhci->cap_regs->hcc_params; 2071 addr = &xhci->cap_regs->hcc_params;
2072 offset = XHCI_HCC_EXT_CAPS(xhci_readl(xhci, addr)); 2072 offset = XHCI_HCC_EXT_CAPS(readl(addr));
2073 if (offset == 0) { 2073 if (offset == 0) {
2074 xhci_err(xhci, "No Extended Capability registers, " 2074 xhci_err(xhci, "No Extended Capability registers, "
2075 "unable to set up roothub.\n"); 2075 "unable to set up roothub.\n");
@@ -2106,7 +2106,7 @@ static int xhci_setup_port_arrays(struct xhci_hcd *xhci, gfp_t flags)
2106 /* count extended protocol capability entries for later caching */ 2106 /* count extended protocol capability entries for later caching */
2107 do { 2107 do {
2108 u32 cap_id; 2108 u32 cap_id;
2109 cap_id = xhci_readl(xhci, tmp_addr); 2109 cap_id = readl(tmp_addr);
2110 if (XHCI_EXT_CAPS_ID(cap_id) == XHCI_EXT_CAPS_PROTOCOL) 2110 if (XHCI_EXT_CAPS_ID(cap_id) == XHCI_EXT_CAPS_PROTOCOL)
2111 cap_count++; 2111 cap_count++;
2112 tmp_offset = XHCI_EXT_CAPS_NEXT(cap_id); 2112 tmp_offset = XHCI_EXT_CAPS_NEXT(cap_id);
@@ -2120,7 +2120,7 @@ static int xhci_setup_port_arrays(struct xhci_hcd *xhci, gfp_t flags)
2120 while (1) { 2120 while (1) {
2121 u32 cap_id; 2121 u32 cap_id;
2122 2122
2123 cap_id = xhci_readl(xhci, addr); 2123 cap_id = readl(addr);
2124 if (XHCI_EXT_CAPS_ID(cap_id) == XHCI_EXT_CAPS_PROTOCOL) 2124 if (XHCI_EXT_CAPS_ID(cap_id) == XHCI_EXT_CAPS_PROTOCOL)
2125 xhci_add_in_port(xhci, num_ports, addr, 2125 xhci_add_in_port(xhci, num_ports, addr,
2126 (u8) XHCI_EXT_PORT_MAJOR(cap_id), 2126 (u8) XHCI_EXT_PORT_MAJOR(cap_id),
@@ -2224,7 +2224,7 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags)
2224 2224
2225 INIT_LIST_HEAD(&xhci->cancel_cmd_list); 2225 INIT_LIST_HEAD(&xhci->cancel_cmd_list);
2226 2226
2227 page_size = xhci_readl(xhci, &xhci->op_regs->page_size); 2227 page_size = readl(&xhci->op_regs->page_size);
2228 xhci_dbg_trace(xhci, trace_xhci_dbg_init, 2228 xhci_dbg_trace(xhci, trace_xhci_dbg_init,
2229 "Supported page size register = 0x%x", page_size); 2229 "Supported page size register = 0x%x", page_size);
2230 for (i = 0; i < 16; i++) { 2230 for (i = 0; i < 16; i++) {
@@ -2247,10 +2247,10 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags)
2247 * Program the Number of Device Slots Enabled field in the CONFIG 2247 * Program the Number of Device Slots Enabled field in the CONFIG
2248 * register with the max value of slots the HC can handle. 2248 * register with the max value of slots the HC can handle.
2249 */ 2249 */
2250 val = HCS_MAX_SLOTS(xhci_readl(xhci, &xhci->cap_regs->hcs_params1)); 2250 val = HCS_MAX_SLOTS(readl(&xhci->cap_regs->hcs_params1));
2251 xhci_dbg_trace(xhci, trace_xhci_dbg_init, 2251 xhci_dbg_trace(xhci, trace_xhci_dbg_init,
2252 "// xHC can handle at most %d device slots.", val); 2252 "// xHC can handle at most %d device slots.", val);
2253 val2 = xhci_readl(xhci, &xhci->op_regs->config_reg); 2253 val2 = readl(&xhci->op_regs->config_reg);
2254 val |= (val2 & ~HCS_SLOTS_MASK); 2254 val |= (val2 & ~HCS_SLOTS_MASK);
2255 xhci_dbg_trace(xhci, trace_xhci_dbg_init, 2255 xhci_dbg_trace(xhci, trace_xhci_dbg_init,
2256 "// Setting Max device slots reg = 0x%x.", val); 2256 "// Setting Max device slots reg = 0x%x.", val);
@@ -2331,7 +2331,7 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags)
2331 */ 2331 */
2332 xhci->cmd_ring_reserved_trbs++; 2332 xhci->cmd_ring_reserved_trbs++;
2333 2333
2334 val = xhci_readl(xhci, &xhci->cap_regs->db_off); 2334 val = readl(&xhci->cap_regs->db_off);
2335 val &= DBOFF_MASK; 2335 val &= DBOFF_MASK;
2336 xhci_dbg_trace(xhci, trace_xhci_dbg_init, 2336 xhci_dbg_trace(xhci, trace_xhci_dbg_init,
2337 "// Doorbell array is located at offset 0x%x" 2337 "// Doorbell array is located at offset 0x%x"
@@ -2382,7 +2382,7 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags)
2382 } 2382 }
2383 2383
2384 /* set ERST count with the number of entries in the segment table */ 2384 /* set ERST count with the number of entries in the segment table */
2385 val = xhci_readl(xhci, &xhci->ir_set->erst_size); 2385 val = readl(&xhci->ir_set->erst_size);
2386 val &= ERST_SIZE_MASK; 2386 val &= ERST_SIZE_MASK;
2387 val |= ERST_NUM_SEGS; 2387 val |= ERST_NUM_SEGS;
2388 xhci_dbg_trace(xhci, trace_xhci_dbg_init, 2388 xhci_dbg_trace(xhci, trace_xhci_dbg_init,
@@ -2431,7 +2431,7 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags)
2431 * is necessary for allowing USB 3.0 devices to do remote wakeup from 2431 * is necessary for allowing USB 3.0 devices to do remote wakeup from
2432 * U3 (device suspend). 2432 * U3 (device suspend).
2433 */ 2433 */
2434 temp = xhci_readl(xhci, &xhci->op_regs->dev_notification); 2434 temp = readl(&xhci->op_regs->dev_notification);
2435 temp &= ~DEV_NOTE_MASK; 2435 temp &= ~DEV_NOTE_MASK;
2436 temp |= DEV_NOTE_FWAKE; 2436 temp |= DEV_NOTE_FWAKE;
2437 xhci_writel(xhci, temp, &xhci->op_regs->dev_notification); 2437 xhci_writel(xhci, temp, &xhci->op_regs->dev_notification);