Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b8a62d54 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki
Browse files

ACPI / hotplug / PCI: Use pci_device_is_present()



Make the ACPI-based PCI hotplug (ACPIPHP) code use
pci_device_is_present() for checking if devices are present instead
of open coding the same thing.

Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
parent cc6254e0
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -689,12 +689,9 @@ static void trim_stale_devices(struct pci_dev *dev)
		alive = (ACPI_SUCCESS(status) && device_status_valid(sta))
			|| acpiphp_no_hotplug(adev);
	}
	if (!alive) {
		u32 v;
	if (!alive)
		alive = pci_device_is_present(dev);

		/* Check if the device responds. */
		alive = pci_bus_read_dev_vendor_id(dev->bus, dev->devfn, &v, 0);
	}
	if (!alive) {
		pci_stop_and_remove_bus_device(dev);
		if (adev)