diff mbox

[v2,3/3] PCI: Hotplug: use new pci function to get device addition state

Message ID 1530268061-17324-4-git-send-email-hari.vyas@broadcom.com (mailing list archive)
State New, archived
Delegated to: Bjorn Helgaas
Headers show

Commit Message

Hari Vyas June 29, 2018, 10:27 a.m. UTC
Due to one race condition happening while updating pci
device addition and master status bits in a particular
scenario, device addition state is moved to a independent
private flag variable.

This change uses newly proposed pci_dev_is_added() function
to retrieve device addition state.

Signed-off-by: Hari Vyas <hari.vyas@broadcom.com>
---
 drivers/pci/hotplug/acpiphp_glue.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
index 3a17b29..ef0b1b6 100644
--- a/drivers/pci/hotplug/acpiphp_glue.c
+++ b/drivers/pci/hotplug/acpiphp_glue.c
@@ -509,7 +509,7 @@  static void enable_slot(struct acpiphp_slot *slot)
 
 	list_for_each_entry(dev, &bus->devices, bus_list) {
 		/* Assume that newly added devices are powered on already. */
-		if (!dev->is_added)
+		if (!pci_dev_is_added(dev))
 			dev->current_state = PCI_D0;
 	}