Subject: [PATCH] PCI, pciehp: Use generic pcie_link_disable Also remove old version with not needed return check. Signed-off-by: Yinghai Lu --- drivers/pci/hotplug/pciehp_hpc.c | 30 +++--------------------------- 1 file changed, 3 insertions(+), 27 deletions(-) Index: linux-2.6/drivers/pci/hotplug/pciehp_hpc.c =================================================================== --- linux-2.6.orig/drivers/pci/hotplug/pciehp_hpc.c +++ linux-2.6/drivers/pci/hotplug/pciehp_hpc.c @@ -305,28 +305,6 @@ int pciehp_check_link_status(struct cont return 0; } -static int __pciehp_link_set(struct controller *ctrl, bool enable) -{ - struct pci_dev *pdev = ctrl_dev(ctrl); - u16 lnk_ctrl; - - pcie_capability_read_word(pdev, PCI_EXP_LNKCTL, &lnk_ctrl); - - if (enable) - lnk_ctrl &= ~PCI_EXP_LNKCTL_LD; - else - lnk_ctrl |= PCI_EXP_LNKCTL_LD; - - pcie_capability_write_word(pdev, PCI_EXP_LNKCTL, lnk_ctrl); - ctrl_dbg(ctrl, "%s: lnk_ctrl = %x\n", __func__, lnk_ctrl); - return 0; -} - -static int pciehp_link_enable(struct controller *ctrl) -{ - return __pciehp_link_set(ctrl, true); -} - void pciehp_get_attention_status(struct slot *slot, u8 *status) { struct controller *ctrl = slot->ctrl; @@ -473,7 +451,6 @@ int pciehp_power_on_slot(struct slot * s struct controller *ctrl = slot->ctrl; struct pci_dev *pdev = ctrl_dev(ctrl); u16 slot_status; - int retval; /* Clear sticky power-fault bit from previous power failures */ pcie_capability_read_word(pdev, PCI_EXP_SLTSTA, &slot_status); @@ -487,11 +464,10 @@ int pciehp_power_on_slot(struct slot * s pci_pcie_cap(ctrl->pcie->port) + PCI_EXP_SLTCTL, PCI_EXP_SLTCTL_PWR_ON); - retval = pciehp_link_enable(ctrl); - if (retval) - ctrl_err(ctrl, "%s: Can not enable the link!\n", __func__); + /* Enable the link */ + pcie_link_disable_set(ctrl->pcie->port, 0); - return retval; + return 0; } void pciehp_power_off_slot(struct slot * slot)