aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
authorYinghai Lu <yinghai@kernel.org>2012-01-27 13:55:12 -0500
committerJesse Barnes <jbarnes@virtuousgeek.org>2012-02-14 11:45:00 -0500
commit4e2ce405b24eef9f4cc947bf5f430ca27b474f1f (patch)
tree94f98ed4f240c44209efe9d2321da27a15feb7bd /drivers/pci
parent2f5d8e4ff947ad6673397083b48719cd6c59cd61 (diff)
PCI: pciehp: make check_link_active more helpful
A few changes: - remove the 'inline' and let the complier decide - return a bool to indicate whether the link was active - add a debug message to indicate link state when it beocmes active Signed-off-by: Yinghai Lu <yinghai@kernel.org> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/hotplug/pciehp_hpc.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c
index 7dc9e33746a6..a8c1f74a1e36 100644
--- a/drivers/pci/hotplug/pciehp_hpc.c
+++ b/drivers/pci/hotplug/pciehp_hpc.c
@@ -241,13 +241,20 @@ static int pcie_write_cmd(struct controller *ctrl, u16 cmd, u16 mask)
241 return retval; 241 return retval;
242} 242}
243 243
244static inline int check_link_active(struct controller *ctrl) 244static bool check_link_active(struct controller *ctrl)
245{ 245{
246 u16 link_status; 246 bool ret = false;
247 u16 lnk_status;
247 248
248 if (pciehp_readw(ctrl, PCI_EXP_LNKSTA, &link_status)) 249 if (pciehp_readw(ctrl, PCI_EXP_LNKSTA, &lnk_status))
249 return 0; 250 return ret;
250 return !!(link_status & PCI_EXP_LNKSTA_DLLLA); 251
252 ret = !!(lnk_status & PCI_EXP_LNKSTA_DLLLA);
253
254 if (ret)
255 ctrl_dbg(ctrl, "%s: lnk_status = %x\n", __func__, lnk_status);
256
257 return ret;
251} 258}
252 259
253static void pcie_wait_link_active(struct controller *ctrl) 260static void pcie_wait_link_active(struct controller *ctrl)