Commit 2611bd18 authored by Sarah Sharp's avatar Sarah Sharp

xhci: Avoid global symbol pollution with handshake.

Non-static xHCI driver symbols should start with the "xhci_" prefix, in
order to avoid namespace pollution.  Rename the "handshake" function to
"xhci_handshake".
Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
Reported-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent 2f02bc8a
...@@ -318,7 +318,7 @@ static int xhci_abort_cmd_ring(struct xhci_hcd *xhci) ...@@ -318,7 +318,7 @@ static int xhci_abort_cmd_ring(struct xhci_hcd *xhci)
* seconds), then it should assume that the there are * seconds), then it should assume that the there are
* larger problems with the xHC and assert HCRST. * larger problems with the xHC and assert HCRST.
*/ */
ret = handshake(xhci, &xhci->op_regs->cmd_ring, ret = xhci_handshake(xhci, &xhci->op_regs->cmd_ring,
CMD_RING_RUNNING, 0, 5 * 1000 * 1000); CMD_RING_RUNNING, 0, 5 * 1000 * 1000);
if (ret < 0) { if (ret < 0) {
xhci_err(xhci, "Stopped the command ring failed, " xhci_err(xhci, "Stopped the command ring failed, "
......
...@@ -40,7 +40,7 @@ MODULE_PARM_DESC(link_quirk, "Don't clear the chain bit on a link TRB"); ...@@ -40,7 +40,7 @@ MODULE_PARM_DESC(link_quirk, "Don't clear the chain bit on a link TRB");
/* TODO: copied from ehci-hcd.c - can this be refactored? */ /* TODO: copied from ehci-hcd.c - can this be refactored? */
/* /*
* handshake - spin reading hc until handshake completes or fails * xhci_handshake - spin reading hc until handshake completes or fails
* @ptr: address of hc register to be read * @ptr: address of hc register to be read
* @mask: bits to look at in result of read * @mask: bits to look at in result of read
* @done: value of those bits when handshake succeeds * @done: value of those bits when handshake succeeds
...@@ -52,7 +52,7 @@ MODULE_PARM_DESC(link_quirk, "Don't clear the chain bit on a link TRB"); ...@@ -52,7 +52,7 @@ MODULE_PARM_DESC(link_quirk, "Don't clear the chain bit on a link TRB");
* handshake done). There are two failure modes: "usec" have passed (major * handshake done). There are two failure modes: "usec" have passed (major
* hardware flakeout), or the register reads as all-ones (hardware removed). * hardware flakeout), or the register reads as all-ones (hardware removed).
*/ */
int handshake(struct xhci_hcd *xhci, void __iomem *ptr, int xhci_handshake(struct xhci_hcd *xhci, void __iomem *ptr,
u32 mask, u32 done, int usec) u32 mask, u32 done, int usec)
{ {
u32 result; u32 result;
...@@ -103,7 +103,7 @@ int xhci_halt(struct xhci_hcd *xhci) ...@@ -103,7 +103,7 @@ int xhci_halt(struct xhci_hcd *xhci)
xhci_dbg(xhci, "// Halt the HC\n"); xhci_dbg(xhci, "// Halt the HC\n");
xhci_quiesce(xhci); xhci_quiesce(xhci);
ret = handshake(xhci, &xhci->op_regs->status, ret = xhci_handshake(xhci, &xhci->op_regs->status,
STS_HALT, STS_HALT, XHCI_MAX_HALT_USEC); STS_HALT, STS_HALT, XHCI_MAX_HALT_USEC);
if (!ret) { if (!ret) {
xhci->xhc_state |= XHCI_STATE_HALTED; xhci->xhc_state |= XHCI_STATE_HALTED;
...@@ -132,7 +132,7 @@ static int xhci_start(struct xhci_hcd *xhci) ...@@ -132,7 +132,7 @@ static int xhci_start(struct xhci_hcd *xhci)
* Wait for the HCHalted Status bit to be 0 to indicate the host is * Wait for the HCHalted Status bit to be 0 to indicate the host is
* running. * running.
*/ */
ret = handshake(xhci, &xhci->op_regs->status, ret = xhci_handshake(xhci, &xhci->op_regs->status,
STS_HALT, 0, XHCI_MAX_HALT_USEC); STS_HALT, 0, XHCI_MAX_HALT_USEC);
if (ret == -ETIMEDOUT) if (ret == -ETIMEDOUT)
xhci_err(xhci, "Host took too long to start, " xhci_err(xhci, "Host took too long to start, "
...@@ -167,7 +167,7 @@ int xhci_reset(struct xhci_hcd *xhci) ...@@ -167,7 +167,7 @@ int xhci_reset(struct xhci_hcd *xhci)
command |= CMD_RESET; command |= CMD_RESET;
xhci_writel(xhci, command, &xhci->op_regs->command); xhci_writel(xhci, command, &xhci->op_regs->command);
ret = handshake(xhci, &xhci->op_regs->command, ret = xhci_handshake(xhci, &xhci->op_regs->command,
CMD_RESET, 0, 10 * 1000 * 1000); CMD_RESET, 0, 10 * 1000 * 1000);
if (ret) if (ret)
return ret; return ret;
...@@ -177,7 +177,7 @@ int xhci_reset(struct xhci_hcd *xhci) ...@@ -177,7 +177,7 @@ int xhci_reset(struct xhci_hcd *xhci)
* xHCI cannot write to any doorbells or operational registers other * xHCI cannot write to any doorbells or operational registers other
* than status until the "Controller Not Ready" flag is cleared. * than status until the "Controller Not Ready" flag is cleared.
*/ */
ret = handshake(xhci, &xhci->op_regs->status, ret = xhci_handshake(xhci, &xhci->op_regs->status,
STS_CNR, 0, 10 * 1000 * 1000); STS_CNR, 0, 10 * 1000 * 1000);
for (i = 0; i < 2; ++i) { for (i = 0; i < 2; ++i) {
...@@ -890,7 +890,7 @@ int xhci_suspend(struct xhci_hcd *xhci) ...@@ -890,7 +890,7 @@ int xhci_suspend(struct xhci_hcd *xhci)
command = xhci_readl(xhci, &xhci->op_regs->command); command = xhci_readl(xhci, &xhci->op_regs->command);
command &= ~CMD_RUN; command &= ~CMD_RUN;
xhci_writel(xhci, command, &xhci->op_regs->command); xhci_writel(xhci, command, &xhci->op_regs->command);
if (handshake(xhci, &xhci->op_regs->status, if (xhci_handshake(xhci, &xhci->op_regs->status,
STS_HALT, STS_HALT, XHCI_MAX_HALT_USEC)) { STS_HALT, STS_HALT, XHCI_MAX_HALT_USEC)) {
xhci_warn(xhci, "WARN: xHC CMD_RUN timeout\n"); xhci_warn(xhci, "WARN: xHC CMD_RUN timeout\n");
spin_unlock_irq(&xhci->lock); spin_unlock_irq(&xhci->lock);
...@@ -905,7 +905,8 @@ int xhci_suspend(struct xhci_hcd *xhci) ...@@ -905,7 +905,8 @@ int xhci_suspend(struct xhci_hcd *xhci)
command = xhci_readl(xhci, &xhci->op_regs->command); command = xhci_readl(xhci, &xhci->op_regs->command);
command |= CMD_CSS; command |= CMD_CSS;
xhci_writel(xhci, command, &xhci->op_regs->command); xhci_writel(xhci, command, &xhci->op_regs->command);
if (handshake(xhci, &xhci->op_regs->status, STS_SAVE, 0, 10 * 1000)) { if (xhci_handshake(xhci, &xhci->op_regs->status,
STS_SAVE, 0, 10 * 1000)) {
xhci_warn(xhci, "WARN: xHC save state timeout\n"); xhci_warn(xhci, "WARN: xHC save state timeout\n");
spin_unlock_irq(&xhci->lock); spin_unlock_irq(&xhci->lock);
return -ETIMEDOUT; return -ETIMEDOUT;
...@@ -967,7 +968,7 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated) ...@@ -967,7 +968,7 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated)
command = xhci_readl(xhci, &xhci->op_regs->command); command = xhci_readl(xhci, &xhci->op_regs->command);
command |= CMD_CRS; command |= CMD_CRS;
xhci_writel(xhci, command, &xhci->op_regs->command); xhci_writel(xhci, command, &xhci->op_regs->command);
if (handshake(xhci, &xhci->op_regs->status, if (xhci_handshake(xhci, &xhci->op_regs->status,
STS_RESTORE, 0, 10 * 1000)) { STS_RESTORE, 0, 10 * 1000)) {
xhci_warn(xhci, "WARN: xHC restore state timeout\n"); xhci_warn(xhci, "WARN: xHC restore state timeout\n");
spin_unlock_irq(&xhci->lock); spin_unlock_irq(&xhci->lock);
...@@ -1035,7 +1036,7 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated) ...@@ -1035,7 +1036,7 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated)
command = xhci_readl(xhci, &xhci->op_regs->command); command = xhci_readl(xhci, &xhci->op_regs->command);
command |= CMD_RUN; command |= CMD_RUN;
xhci_writel(xhci, command, &xhci->op_regs->command); xhci_writel(xhci, command, &xhci->op_regs->command);
handshake(xhci, &xhci->op_regs->status, STS_HALT, xhci_handshake(xhci, &xhci->op_regs->status, STS_HALT,
0, 250 * 1000); 0, 250 * 1000);
/* step 5: walk topology and initialize portsc, /* step 5: walk topology and initialize portsc,
...@@ -3874,7 +3875,8 @@ static int xhci_usb2_software_lpm_test(struct usb_hcd *hcd, ...@@ -3874,7 +3875,8 @@ static int xhci_usb2_software_lpm_test(struct usb_hcd *hcd,
spin_lock_irqsave(&xhci->lock, flags); spin_lock_irqsave(&xhci->lock, flags);
/* Check L1 Status */ /* Check L1 Status */
ret = handshake(xhci, pm_addr, PORT_L1S_MASK, PORT_L1S_SUCCESS, 125); ret = xhci_handshake(xhci, pm_addr,
PORT_L1S_MASK, PORT_L1S_SUCCESS, 125);
if (ret != -ETIMEDOUT) { if (ret != -ETIMEDOUT) {
/* enter L1 successfully */ /* enter L1 successfully */
temp = xhci_readl(xhci, addr); temp = xhci_readl(xhci, addr);
......
...@@ -1720,7 +1720,7 @@ static inline void xhci_unregister_plat(void) ...@@ -1720,7 +1720,7 @@ static inline void xhci_unregister_plat(void)
/* xHCI host controller glue */ /* xHCI host controller glue */
typedef void (*xhci_get_quirks_t)(struct device *, struct xhci_hcd *); typedef void (*xhci_get_quirks_t)(struct device *, struct xhci_hcd *);
int handshake(struct xhci_hcd *xhci, void __iomem *ptr, int xhci_handshake(struct xhci_hcd *xhci, void __iomem *ptr,
u32 mask, u32 done, int usec); u32 mask, u32 done, int usec);
void xhci_quiesce(struct xhci_hcd *xhci); void xhci_quiesce(struct xhci_hcd *xhci);
int xhci_halt(struct xhci_hcd *xhci); int xhci_halt(struct xhci_hcd *xhci);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment