Commit 6dae6202 authored by Bjorn Helgaas's avatar Bjorn Helgaas

PCI: pciehp: Make various functions void since they can't fail

These functions:

  pcie_enable_notification()
  pciehp_power_off_slot()
  pciehp_get_power_status()
  pciehp_get_attention_status()
  pciehp_set_attention_status()
  pciehp_get_latch_status()
  pciehp_get_adapter_status()
  pcie_write_cmd()

now always return success, so this patch makes them void and drops the
error-checking code in their callers.

No functional change.
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
parent 1a84b99c
...@@ -140,15 +140,15 @@ struct controller *pcie_init(struct pcie_device *dev); ...@@ -140,15 +140,15 @@ struct controller *pcie_init(struct pcie_device *dev);
int pcie_init_notification(struct controller *ctrl); int pcie_init_notification(struct controller *ctrl);
int pciehp_enable_slot(struct slot *p_slot); int pciehp_enable_slot(struct slot *p_slot);
int pciehp_disable_slot(struct slot *p_slot); int pciehp_disable_slot(struct slot *p_slot);
int pcie_enable_notification(struct controller *ctrl); void pcie_enable_notification(struct controller *ctrl);
int pciehp_power_on_slot(struct slot *slot); int pciehp_power_on_slot(struct slot *slot);
int pciehp_power_off_slot(struct slot *slot); void pciehp_power_off_slot(struct slot *slot);
int pciehp_get_power_status(struct slot *slot, u8 *status); void pciehp_get_power_status(struct slot *slot, u8 *status);
int pciehp_get_attention_status(struct slot *slot, u8 *status); void pciehp_get_attention_status(struct slot *slot, u8 *status);
int pciehp_set_attention_status(struct slot *slot, u8 status); void pciehp_set_attention_status(struct slot *slot, u8 status);
int pciehp_get_latch_status(struct slot *slot, u8 *status); void pciehp_get_latch_status(struct slot *slot, u8 *status);
int pciehp_get_adapter_status(struct slot *slot, u8 *status); void pciehp_get_adapter_status(struct slot *slot, u8 *status);
int pciehp_query_power_fault(struct slot *slot); int pciehp_query_power_fault(struct slot *slot);
void pciehp_green_led_on(struct slot *slot); void pciehp_green_led_on(struct slot *slot);
void pciehp_green_led_off(struct slot *slot); void pciehp_green_led_off(struct slot *slot);
......
...@@ -160,7 +160,8 @@ static int set_attention_status(struct hotplug_slot *hotplug_slot, u8 status) ...@@ -160,7 +160,8 @@ static int set_attention_status(struct hotplug_slot *hotplug_slot, u8 status)
ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n", ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n",
__func__, slot_name(slot)); __func__, slot_name(slot));
return pciehp_set_attention_status(slot, status); pciehp_set_attention_status(slot, status);
return 0;
} }
...@@ -192,7 +193,8 @@ static int get_power_status(struct hotplug_slot *hotplug_slot, u8 *value) ...@@ -192,7 +193,8 @@ static int get_power_status(struct hotplug_slot *hotplug_slot, u8 *value)
ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n", ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n",
__func__, slot_name(slot)); __func__, slot_name(slot));
return pciehp_get_power_status(slot, value); pciehp_get_power_status(slot, value);
return 0;
} }
static int get_attention_status(struct hotplug_slot *hotplug_slot, u8 *value) static int get_attention_status(struct hotplug_slot *hotplug_slot, u8 *value)
...@@ -202,7 +204,8 @@ static int get_attention_status(struct hotplug_slot *hotplug_slot, u8 *value) ...@@ -202,7 +204,8 @@ static int get_attention_status(struct hotplug_slot *hotplug_slot, u8 *value)
ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n", ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n",
__func__, slot_name(slot)); __func__, slot_name(slot));
return pciehp_get_attention_status(slot, value); pciehp_get_attention_status(slot, value);
return 0;
} }
static int get_latch_status(struct hotplug_slot *hotplug_slot, u8 *value) static int get_latch_status(struct hotplug_slot *hotplug_slot, u8 *value)
...@@ -212,7 +215,8 @@ static int get_latch_status(struct hotplug_slot *hotplug_slot, u8 *value) ...@@ -212,7 +215,8 @@ static int get_latch_status(struct hotplug_slot *hotplug_slot, u8 *value)
ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n", ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n",
__func__, slot_name(slot)); __func__, slot_name(slot));
return pciehp_get_latch_status(slot, value); pciehp_get_latch_status(slot, value);
return 0;
} }
static int get_adapter_status(struct hotplug_slot *hotplug_slot, u8 *value) static int get_adapter_status(struct hotplug_slot *hotplug_slot, u8 *value)
...@@ -222,7 +226,8 @@ static int get_adapter_status(struct hotplug_slot *hotplug_slot, u8 *value) ...@@ -222,7 +226,8 @@ static int get_adapter_status(struct hotplug_slot *hotplug_slot, u8 *value)
ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n", ctrl_dbg(slot->ctrl, "%s: physical_slot = %s\n",
__func__, slot_name(slot)); __func__, slot_name(slot));
return pciehp_get_adapter_status(slot, value); pciehp_get_adapter_status(slot, value);
return 0;
} }
static int reset_slot(struct hotplug_slot *hotplug_slot, int probe) static int reset_slot(struct hotplug_slot *hotplug_slot, int probe)
......
...@@ -158,11 +158,8 @@ static void set_slot_off(struct controller *ctrl, struct slot * pslot) ...@@ -158,11 +158,8 @@ static void set_slot_off(struct controller *ctrl, struct slot * pslot)
{ {
/* turn off slot, turn on Amber LED, turn off Green LED if supported*/ /* turn off slot, turn on Amber LED, turn off Green LED if supported*/
if (POWER_CTRL(ctrl)) { if (POWER_CTRL(ctrl)) {
if (pciehp_power_off_slot(pslot)) { pciehp_power_off_slot(pslot);
ctrl_err(ctrl,
"Issue of Slot Power Off command failed\n");
return;
}
/* /*
* After turning power off, we must wait for at least 1 second * After turning power off, we must wait for at least 1 second
* before taking any action that relies on power having been * before taking any action that relies on power having been
...@@ -174,13 +171,8 @@ static void set_slot_off(struct controller *ctrl, struct slot * pslot) ...@@ -174,13 +171,8 @@ static void set_slot_off(struct controller *ctrl, struct slot * pslot)
if (PWR_LED(ctrl)) if (PWR_LED(ctrl))
pciehp_green_led_off(pslot); pciehp_green_led_off(pslot);
if (ATTN_LED(ctrl)) { if (ATTN_LED(ctrl))
if (pciehp_set_attention_status(pslot, 1)) { pciehp_set_attention_status(pslot, 1);
ctrl_err(ctrl,
"Issue of Set Attention Led command failed\n");
return;
}
}
} }
/** /**
...@@ -243,7 +235,7 @@ static int board_added(struct slot *p_slot) ...@@ -243,7 +235,7 @@ static int board_added(struct slot *p_slot)
*/ */
static int remove_board(struct slot *p_slot) static int remove_board(struct slot *p_slot)
{ {
int retval = 0; int retval;
struct controller *ctrl = p_slot->ctrl; struct controller *ctrl = p_slot->ctrl;
retval = pciehp_unconfigure_device(p_slot); retval = pciehp_unconfigure_device(p_slot);
...@@ -251,13 +243,8 @@ static int remove_board(struct slot *p_slot) ...@@ -251,13 +243,8 @@ static int remove_board(struct slot *p_slot)
return retval; return retval;
if (POWER_CTRL(ctrl)) { if (POWER_CTRL(ctrl)) {
/* power off slot */ pciehp_power_off_slot(p_slot);
retval = pciehp_power_off_slot(p_slot);
if (retval) {
ctrl_err(ctrl,
"Issue of Slot Disable command failed\n");
return retval;
}
/* /*
* After turning power off, we must wait for at least 1 second * After turning power off, we must wait for at least 1 second
* before taking any action that relies on power having been * before taking any action that relies on power having been
...@@ -482,14 +469,14 @@ int pciehp_enable_slot(struct slot *p_slot) ...@@ -482,14 +469,14 @@ int pciehp_enable_slot(struct slot *p_slot)
int rc; int rc;
struct controller *ctrl = p_slot->ctrl; struct controller *ctrl = p_slot->ctrl;
rc = pciehp_get_adapter_status(p_slot, &getstatus); pciehp_get_adapter_status(p_slot, &getstatus);
if (rc || !getstatus) { if (!getstatus) {
ctrl_info(ctrl, "No adapter on slot(%s)\n", slot_name(p_slot)); ctrl_info(ctrl, "No adapter on slot(%s)\n", slot_name(p_slot));
return -ENODEV; return -ENODEV;
} }
if (MRL_SENS(p_slot->ctrl)) { if (MRL_SENS(p_slot->ctrl)) {
rc = pciehp_get_latch_status(p_slot, &getstatus); pciehp_get_latch_status(p_slot, &getstatus);
if (rc || getstatus) { if (getstatus) {
ctrl_info(ctrl, "Latch open on slot(%s)\n", ctrl_info(ctrl, "Latch open on slot(%s)\n",
slot_name(p_slot)); slot_name(p_slot));
return -ENODEV; return -ENODEV;
...@@ -497,8 +484,8 @@ int pciehp_enable_slot(struct slot *p_slot) ...@@ -497,8 +484,8 @@ int pciehp_enable_slot(struct slot *p_slot)
} }
if (POWER_CTRL(p_slot->ctrl)) { if (POWER_CTRL(p_slot->ctrl)) {
rc = pciehp_get_power_status(p_slot, &getstatus); pciehp_get_power_status(p_slot, &getstatus);
if (rc || getstatus) { if (getstatus) {
ctrl_info(ctrl, "Already enabled on slot(%s)\n", ctrl_info(ctrl, "Already enabled on slot(%s)\n",
slot_name(p_slot)); slot_name(p_slot));
return -EINVAL; return -EINVAL;
...@@ -518,15 +505,14 @@ int pciehp_enable_slot(struct slot *p_slot) ...@@ -518,15 +505,14 @@ int pciehp_enable_slot(struct slot *p_slot)
int pciehp_disable_slot(struct slot *p_slot) int pciehp_disable_slot(struct slot *p_slot)
{ {
u8 getstatus = 0; u8 getstatus = 0;
int ret = 0;
struct controller *ctrl = p_slot->ctrl; struct controller *ctrl = p_slot->ctrl;
if (!p_slot->ctrl) if (!p_slot->ctrl)
return 1; return 1;
if (!HP_SUPR_RM(p_slot->ctrl)) { if (!HP_SUPR_RM(p_slot->ctrl)) {
ret = pciehp_get_adapter_status(p_slot, &getstatus); pciehp_get_adapter_status(p_slot, &getstatus);
if (ret || !getstatus) { if (!getstatus) {
ctrl_info(ctrl, "No adapter on slot(%s)\n", ctrl_info(ctrl, "No adapter on slot(%s)\n",
slot_name(p_slot)); slot_name(p_slot));
return -ENODEV; return -ENODEV;
...@@ -534,8 +520,8 @@ int pciehp_disable_slot(struct slot *p_slot) ...@@ -534,8 +520,8 @@ int pciehp_disable_slot(struct slot *p_slot)
} }
if (MRL_SENS(p_slot->ctrl)) { if (MRL_SENS(p_slot->ctrl)) {
ret = pciehp_get_latch_status(p_slot, &getstatus); pciehp_get_latch_status(p_slot, &getstatus);
if (ret || getstatus) { if (getstatus) {
ctrl_info(ctrl, "Latch open on slot(%s)\n", ctrl_info(ctrl, "Latch open on slot(%s)\n",
slot_name(p_slot)); slot_name(p_slot));
return -ENODEV; return -ENODEV;
...@@ -543,8 +529,8 @@ int pciehp_disable_slot(struct slot *p_slot) ...@@ -543,8 +529,8 @@ int pciehp_disable_slot(struct slot *p_slot)
} }
if (POWER_CTRL(p_slot->ctrl)) { if (POWER_CTRL(p_slot->ctrl)) {
ret = pciehp_get_power_status(p_slot, &getstatus); pciehp_get_power_status(p_slot, &getstatus);
if (ret || !getstatus) { if (!getstatus) {
ctrl_info(ctrl, "Already disabled on slot(%s)\n", ctrl_info(ctrl, "Already disabled on slot(%s)\n",
slot_name(p_slot)); slot_name(p_slot));
return -EINVAL; return -EINVAL;
......
...@@ -153,7 +153,7 @@ static void pcie_wait_cmd(struct controller *ctrl, int poll) ...@@ -153,7 +153,7 @@ static void pcie_wait_cmd(struct controller *ctrl, int poll)
* @cmd: command value written to slot control register * @cmd: command value written to slot control register
* @mask: bitmask of slot control register to be modified * @mask: bitmask of slot control register to be modified
*/ */
static int pcie_write_cmd(struct controller *ctrl, u16 cmd, u16 mask) static void pcie_write_cmd(struct controller *ctrl, u16 cmd, u16 mask)
{ {
struct pci_dev *pdev = ctrl_dev(ctrl); struct pci_dev *pdev = ctrl_dev(ctrl);
u16 slot_status; u16 slot_status;
...@@ -208,7 +208,6 @@ static int pcie_write_cmd(struct controller *ctrl, u16 cmd, u16 mask) ...@@ -208,7 +208,6 @@ static int pcie_write_cmd(struct controller *ctrl, u16 cmd, u16 mask)
pcie_wait_cmd(ctrl, poll); pcie_wait_cmd(ctrl, poll);
} }
mutex_unlock(&ctrl->ctrl_lock); mutex_unlock(&ctrl->ctrl_lock);
return 0;
} }
static bool check_link_active(struct controller *ctrl) static bool check_link_active(struct controller *ctrl)
...@@ -342,7 +341,7 @@ static int pciehp_link_disable(struct controller *ctrl) ...@@ -342,7 +341,7 @@ static int pciehp_link_disable(struct controller *ctrl)
return __pciehp_link_set(ctrl, false); return __pciehp_link_set(ctrl, false);
} }
int pciehp_get_attention_status(struct slot *slot, u8 *status) void pciehp_get_attention_status(struct slot *slot, u8 *status)
{ {
struct controller *ctrl = slot->ctrl; struct controller *ctrl = slot->ctrl;
struct pci_dev *pdev = ctrl_dev(ctrl); struct pci_dev *pdev = ctrl_dev(ctrl);
...@@ -372,11 +371,9 @@ int pciehp_get_attention_status(struct slot *slot, u8 *status) ...@@ -372,11 +371,9 @@ int pciehp_get_attention_status(struct slot *slot, u8 *status)
*status = 0xFF; *status = 0xFF;
break; break;
} }
return 0;
} }
int pciehp_get_power_status(struct slot *slot, u8 *status) void pciehp_get_power_status(struct slot *slot, u8 *status)
{ {
struct controller *ctrl = slot->ctrl; struct controller *ctrl = slot->ctrl;
struct pci_dev *pdev = ctrl_dev(ctrl); struct pci_dev *pdev = ctrl_dev(ctrl);
...@@ -400,28 +397,24 @@ int pciehp_get_power_status(struct slot *slot, u8 *status) ...@@ -400,28 +397,24 @@ int pciehp_get_power_status(struct slot *slot, u8 *status)
*status = 0xFF; *status = 0xFF;
break; break;
} }
return 0;
} }
int pciehp_get_latch_status(struct slot *slot, u8 *status) void pciehp_get_latch_status(struct slot *slot, u8 *status)
{ {
struct pci_dev *pdev = ctrl_dev(slot->ctrl); struct pci_dev *pdev = ctrl_dev(slot->ctrl);
u16 slot_status; u16 slot_status;
pcie_capability_read_word(pdev, PCI_EXP_SLTSTA, &slot_status); pcie_capability_read_word(pdev, PCI_EXP_SLTSTA, &slot_status);
*status = !!(slot_status & PCI_EXP_SLTSTA_MRLSS); *status = !!(slot_status & PCI_EXP_SLTSTA_MRLSS);
return 0;
} }
int pciehp_get_adapter_status(struct slot *slot, u8 *status) void pciehp_get_adapter_status(struct slot *slot, u8 *status)
{ {
struct pci_dev *pdev = ctrl_dev(slot->ctrl); struct pci_dev *pdev = ctrl_dev(slot->ctrl);
u16 slot_status; u16 slot_status;
pcie_capability_read_word(pdev, PCI_EXP_SLTSTA, &slot_status); pcie_capability_read_word(pdev, PCI_EXP_SLTSTA, &slot_status);
*status = !!(slot_status & PCI_EXP_SLTSTA_PDS); *status = !!(slot_status & PCI_EXP_SLTSTA_PDS);
return 0;
} }
int pciehp_query_power_fault(struct slot *slot) int pciehp_query_power_fault(struct slot *slot)
...@@ -433,7 +426,7 @@ int pciehp_query_power_fault(struct slot *slot) ...@@ -433,7 +426,7 @@ int pciehp_query_power_fault(struct slot *slot)
return !!(slot_status & PCI_EXP_SLTSTA_PFD); return !!(slot_status & PCI_EXP_SLTSTA_PFD);
} }
int pciehp_set_attention_status(struct slot *slot, u8 value) void pciehp_set_attention_status(struct slot *slot, u8 value)
{ {
struct controller *ctrl = slot->ctrl; struct controller *ctrl = slot->ctrl;
u16 slot_cmd; u16 slot_cmd;
...@@ -451,11 +444,11 @@ int pciehp_set_attention_status(struct slot *slot, u8 value) ...@@ -451,11 +444,11 @@ int pciehp_set_attention_status(struct slot *slot, u8 value)
slot_cmd = 0x0080; slot_cmd = 0x0080;
break; break;
default: default:
return -EINVAL; return;
} }
ctrl_dbg(ctrl, "%s: SLOTCTRL %x write cmd %x\n", __func__, ctrl_dbg(ctrl, "%s: SLOTCTRL %x write cmd %x\n", __func__,
pci_pcie_cap(ctrl->pcie->port) + PCI_EXP_SLTCTL, slot_cmd); pci_pcie_cap(ctrl->pcie->port) + PCI_EXP_SLTCTL, slot_cmd);
return pcie_write_cmd(ctrl, slot_cmd, cmd_mask); pcie_write_cmd(ctrl, slot_cmd, cmd_mask);
} }
void pciehp_green_led_on(struct slot *slot) void pciehp_green_led_on(struct slot *slot)
...@@ -515,11 +508,7 @@ int pciehp_power_on_slot(struct slot * slot) ...@@ -515,11 +508,7 @@ int pciehp_power_on_slot(struct slot * slot)
slot_cmd = POWER_ON; slot_cmd = POWER_ON;
cmd_mask = PCI_EXP_SLTCTL_PCC; cmd_mask = PCI_EXP_SLTCTL_PCC;
retval = pcie_write_cmd(ctrl, slot_cmd, cmd_mask); pcie_write_cmd(ctrl, slot_cmd, cmd_mask);
if (retval) {
ctrl_err(ctrl, "Write %x command failed!\n", slot_cmd);
return retval;
}
ctrl_dbg(ctrl, "%s: SLOTCTRL %x write cmd %x\n", __func__, ctrl_dbg(ctrl, "%s: SLOTCTRL %x write cmd %x\n", __func__,
pci_pcie_cap(ctrl->pcie->port) + PCI_EXP_SLTCTL, slot_cmd); pci_pcie_cap(ctrl->pcie->port) + PCI_EXP_SLTCTL, slot_cmd);
...@@ -530,12 +519,11 @@ int pciehp_power_on_slot(struct slot * slot) ...@@ -530,12 +519,11 @@ int pciehp_power_on_slot(struct slot * slot)
return retval; return retval;
} }
int pciehp_power_off_slot(struct slot * slot) void pciehp_power_off_slot(struct slot * slot)
{ {
struct controller *ctrl = slot->ctrl; struct controller *ctrl = slot->ctrl;
u16 slot_cmd; u16 slot_cmd;
u16 cmd_mask; u16 cmd_mask;
int retval;
/* Disable the link at first */ /* Disable the link at first */
pciehp_link_disable(ctrl); pciehp_link_disable(ctrl);
...@@ -547,14 +535,9 @@ int pciehp_power_off_slot(struct slot * slot) ...@@ -547,14 +535,9 @@ int pciehp_power_off_slot(struct slot * slot)
slot_cmd = POWER_OFF; slot_cmd = POWER_OFF;
cmd_mask = PCI_EXP_SLTCTL_PCC; cmd_mask = PCI_EXP_SLTCTL_PCC;
retval = pcie_write_cmd(ctrl, slot_cmd, cmd_mask); pcie_write_cmd(ctrl, slot_cmd, cmd_mask);
if (retval) {
ctrl_err(ctrl, "Write command failed!\n");
return retval;
}
ctrl_dbg(ctrl, "%s: SLOTCTRL %x write cmd %x\n", __func__, ctrl_dbg(ctrl, "%s: SLOTCTRL %x write cmd %x\n", __func__,
pci_pcie_cap(ctrl->pcie->port) + PCI_EXP_SLTCTL, slot_cmd); pci_pcie_cap(ctrl->pcie->port) + PCI_EXP_SLTCTL, slot_cmd);
return 0;
} }
static irqreturn_t pcie_isr(int irq, void *dev_id) static irqreturn_t pcie_isr(int irq, void *dev_id)
...@@ -617,7 +600,7 @@ static irqreturn_t pcie_isr(int irq, void *dev_id) ...@@ -617,7 +600,7 @@ static irqreturn_t pcie_isr(int irq, void *dev_id)
return IRQ_HANDLED; return IRQ_HANDLED;
} }
int pcie_enable_notification(struct controller *ctrl) void pcie_enable_notification(struct controller *ctrl)
{ {
u16 cmd, mask; u16 cmd, mask;
...@@ -643,22 +626,18 @@ int pcie_enable_notification(struct controller *ctrl) ...@@ -643,22 +626,18 @@ int pcie_enable_notification(struct controller *ctrl)
PCI_EXP_SLTCTL_MRLSCE | PCI_EXP_SLTCTL_PFDE | PCI_EXP_SLTCTL_MRLSCE | PCI_EXP_SLTCTL_PFDE |
PCI_EXP_SLTCTL_HPIE | PCI_EXP_SLTCTL_CCIE); PCI_EXP_SLTCTL_HPIE | PCI_EXP_SLTCTL_CCIE);
if (pcie_write_cmd(ctrl, cmd, mask)) { pcie_write_cmd(ctrl, cmd, mask);
ctrl_err(ctrl, "Cannot enable software notification\n");
return -1;
}
return 0;
} }
static void pcie_disable_notification(struct controller *ctrl) static void pcie_disable_notification(struct controller *ctrl)
{ {
u16 mask; u16 mask;
mask = (PCI_EXP_SLTCTL_PDCE | PCI_EXP_SLTCTL_ABPE | mask = (PCI_EXP_SLTCTL_PDCE | PCI_EXP_SLTCTL_ABPE |
PCI_EXP_SLTCTL_MRLSCE | PCI_EXP_SLTCTL_PFDE | PCI_EXP_SLTCTL_MRLSCE | PCI_EXP_SLTCTL_PFDE |
PCI_EXP_SLTCTL_HPIE | PCI_EXP_SLTCTL_CCIE | PCI_EXP_SLTCTL_HPIE | PCI_EXP_SLTCTL_CCIE |
PCI_EXP_SLTCTL_DLLSCE); PCI_EXP_SLTCTL_DLLSCE);
if (pcie_write_cmd(ctrl, 0, mask)) pcie_write_cmd(ctrl, 0, mask);
ctrl_warn(ctrl, "Cannot disable software notification\n");
} }
/* /*
...@@ -698,10 +677,7 @@ int pcie_init_notification(struct controller *ctrl) ...@@ -698,10 +677,7 @@ int pcie_init_notification(struct controller *ctrl)
{ {
if (pciehp_request_irq(ctrl)) if (pciehp_request_irq(ctrl))
return -1; return -1;
if (pcie_enable_notification(ctrl)) { pcie_enable_notification(ctrl);
pciehp_free_irq(ctrl);
return -1;
}
ctrl->notification_enabled = 1; ctrl->notification_enabled = 1;
return 0; return 0;
} }
......
...@@ -78,7 +78,7 @@ int pciehp_configure_device(struct slot *p_slot) ...@@ -78,7 +78,7 @@ int pciehp_configure_device(struct slot *p_slot)
int pciehp_unconfigure_device(struct slot *p_slot) int pciehp_unconfigure_device(struct slot *p_slot)
{ {
int ret, rc = 0; int rc = 0;
u8 bctl = 0; u8 bctl = 0;
u8 presence = 0; u8 presence = 0;
struct pci_dev *dev, *temp; struct pci_dev *dev, *temp;
...@@ -88,9 +88,7 @@ int pciehp_unconfigure_device(struct slot *p_slot) ...@@ -88,9 +88,7 @@ int pciehp_unconfigure_device(struct slot *p_slot)
ctrl_dbg(ctrl, "%s: domain:bus:dev = %04x:%02x:00\n", ctrl_dbg(ctrl, "%s: domain:bus:dev = %04x:%02x:00\n",
__func__, pci_domain_nr(parent), parent->number); __func__, pci_domain_nr(parent), parent->number);
ret = pciehp_get_adapter_status(p_slot, &presence); pciehp_get_adapter_status(p_slot, &presence);
if (ret)
presence = 0;
/* /*
* Stopping an SR-IOV PF device removes all the associated VFs, * Stopping an SR-IOV PF device removes all the associated VFs,
......
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