Skip to content

Commit be9edde

Browse files
l1kbjorn-helgaas
authored andcommitted
PCI/PM: Stop needlessly clearing state_saved on enumeration and thaw
The state_saved flag tells the PCI core whether a driver assumes responsibility to save Config Space and put the device into a low power state on suspend. The flag is currently initialized to false on enumeration, even though it already is false (because struct pci_dev is zeroed by kzalloc()) and even though it is set to false before commencing the suspend sequence (the only code path where it's relevant). The flag is also set to false in pci_pm_thaw(), i.e. on resume, when it's no longer relevant. Drop these two superfluous flag assignments for simplicity. Signed-off-by: Lukas Wunner <lukas@wunner.de> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Rafael J. Wysocki (Intel) <rafael@kernel.org> Link: https://patch.msgid.link/fd167945bd7852e1ca08cd4b202130659eea2c2f.1763483367.git.lukas@wunner.de
1 parent 894f475 commit be9edde

2 files changed

Lines changed: 0 additions & 4 deletions

File tree

drivers/pci/pci-driver.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1133,8 +1133,6 @@ static int pci_pm_thaw(struct device *dev)
11331133
pci_pm_reenable_device(pci_dev);
11341134
}
11351135

1136-
pci_dev->state_saved = false;
1137-
11381136
return error;
11391137
}
11401138

drivers/pci/probe.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2747,8 +2747,6 @@ void pci_device_add(struct pci_dev *dev, struct pci_bus *bus)
27472747

27482748
pci_reassigndev_resource_alignment(dev);
27492749

2750-
dev->state_saved = false;
2751-
27522750
pci_init_capabilities(dev);
27532751

27542752
/*

0 commit comments

Comments
 (0)