mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-29 22:02:02 +00:00
PCI: Drop pci_device_remove() test of pci_dev->driver
[ Upstream commit097d9d4144
] When the driver core calls pci_device_remove(), there is a driver bound to the device, so pci_dev->driver is never NULL. Remove the unnecessary test of pci_dev->driver. Link: https://lore.kernel.org/r/20211004125935.2300113-2-u.kleine-koenig@pengutronix.de Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Stable-dep-of:9d5286d4e7
("PCI/PM: Drain runtime-idle callbacks before driver removal") Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
0f8957f507
commit
064300ccb0
1 changed files with 7 additions and 9 deletions
|
@ -439,7 +439,6 @@ static int pci_device_remove(struct device *dev)
|
|||
struct pci_dev *pci_dev = to_pci_dev(dev);
|
||||
struct pci_driver *drv = pci_dev->driver;
|
||||
|
||||
if (drv) {
|
||||
if (drv->remove) {
|
||||
pm_runtime_get_sync(dev);
|
||||
drv->remove(pci_dev);
|
||||
|
@ -448,7 +447,6 @@ static int pci_device_remove(struct device *dev)
|
|||
pcibios_free_irq(pci_dev);
|
||||
pci_dev->driver = NULL;
|
||||
pci_iov_remove(pci_dev);
|
||||
}
|
||||
|
||||
/* Undo the runtime PM settings in local_pci_probe() */
|
||||
pm_runtime_put_sync(dev);
|
||||
|
|
Loading…
Reference in a new issue