aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/xhci-ring.c
diff options
context:
space:
mode:
authorSarah Sharp <sarah.a.sharp@linux.intel.com>2010-12-15 14:56:29 -0500
committerSarah Sharp <sarah.a.sharp@linux.intel.com>2011-03-13 21:07:08 -0400
commit518e848ea8e2932ce18ce2daef8ad5f55a145f27 (patch)
tree623b2a258580f6fd28584d83c276c133ed423a15 /drivers/usb/host/xhci-ring.c
parent1d5810b6923c76fc95e52d9d3491c91824c2f075 (diff)
xhci: Rename variables and reduce register reads.
The xhci_bus_suspend() and xhci_bus_resume() functions are a bit hard to read, because they have an ambiguously named variable "port". Rename it to "port_index". Introduce a new temporary variable, "max_ports" that holds the maximum number of roothub ports the host controller supports. This will reduce the number of register reads, and make it easy to change the maximum number of ports when there are two roothubs. Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Diffstat (limited to 'drivers/usb/host/xhci-ring.c')
-rw-r--r--drivers/usb/host/xhci-ring.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index b36d3b003fee..3264d6275bf2 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -1163,7 +1163,7 @@ static void handle_port_status(struct xhci_hcd *xhci,
1163 u32 port_id; 1163 u32 port_id;
1164 u32 temp, temp1; 1164 u32 temp, temp1;
1165 u32 __iomem *addr; 1165 u32 __iomem *addr;
1166 int ports; 1166 int max_ports;
1167 int slot_id; 1167 int slot_id;
1168 1168
1169 /* Port status change events always have a successful completion code */ 1169 /* Port status change events always have a successful completion code */
@@ -1174,8 +1174,8 @@ static void handle_port_status(struct xhci_hcd *xhci,
1174 port_id = GET_PORT_ID(event->generic.field[0]); 1174 port_id = GET_PORT_ID(event->generic.field[0]);
1175 xhci_dbg(xhci, "Port Status Change Event for port %d\n", port_id); 1175 xhci_dbg(xhci, "Port Status Change Event for port %d\n", port_id);
1176 1176
1177 ports = HCS_MAX_PORTS(xhci->hcs_params1); 1177 max_ports = HCS_MAX_PORTS(xhci->hcs_params1);
1178 if ((port_id <= 0) || (port_id > ports)) { 1178 if ((port_id <= 0) || (port_id > max_ports)) {
1179 xhci_warn(xhci, "Invalid port id %d\n", port_id); 1179 xhci_warn(xhci, "Invalid port id %d\n", port_id);
1180 goto cleanup; 1180 goto cleanup;
1181 } 1181 }