ACPI: kill acpi_get_physical_pci_device()
acpi_get_pci_dev() is (hopefully) better, and all callers have been converted, so let's get rid of this duplicated functionality. Cc: Thomas Renninger <trenn@suse.de> Signed-off-by: Alex Chiang <achiang@hp.com> Acked-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Len Brown <len.brown@intel.com>
This commit is contained in:
committed by
Len Brown
parent
1e4cffe78e
commit
7fe2a6c275
@@ -140,46 +140,6 @@ struct device *acpi_get_physical_device(acpi_handle handle)
|
|||||||
|
|
||||||
EXPORT_SYMBOL(acpi_get_physical_device);
|
EXPORT_SYMBOL(acpi_get_physical_device);
|
||||||
|
|
||||||
/* ToDo: When a PCI bridge is found, return the PCI device behind the bridge
|
|
||||||
* This should work in general, but did not on a Lenovo T61 for the
|
|
||||||
* graphics card. But this must be fixed when the PCI device is
|
|
||||||
* bound and the kernel device struct is attached to the acpi device
|
|
||||||
* Note: A success call will increase reference count by one
|
|
||||||
* Do call put_device(dev) on the returned device then
|
|
||||||
*/
|
|
||||||
struct device *acpi_get_physical_pci_device(acpi_handle handle)
|
|
||||||
{
|
|
||||||
struct device *dev;
|
|
||||||
long long device_id;
|
|
||||||
acpi_status status;
|
|
||||||
|
|
||||||
status =
|
|
||||||
acpi_evaluate_integer(handle, "_ADR", NULL, &device_id);
|
|
||||||
|
|
||||||
if (ACPI_FAILURE(status))
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
/* We need to attempt to determine whether the _ADR refers to a
|
|
||||||
PCI device or not. There's no terribly good way to do this,
|
|
||||||
so the best we can hope for is to assume that there'll never
|
|
||||||
be a device in the host bridge */
|
|
||||||
if (device_id >= 0x10000) {
|
|
||||||
/* It looks like a PCI device. Does it exist? */
|
|
||||||
dev = acpi_get_physical_device(handle);
|
|
||||||
} else {
|
|
||||||
/* It doesn't look like a PCI device. Does its parent
|
|
||||||
exist? */
|
|
||||||
acpi_handle phandle;
|
|
||||||
if (acpi_get_parent(handle, &phandle))
|
|
||||||
return NULL;
|
|
||||||
dev = acpi_get_physical_device(phandle);
|
|
||||||
}
|
|
||||||
if (!dev)
|
|
||||||
return NULL;
|
|
||||||
return dev;
|
|
||||||
}
|
|
||||||
EXPORT_SYMBOL(acpi_get_physical_pci_device);
|
|
||||||
|
|
||||||
static int acpi_bind_one(struct device *dev, acpi_handle handle)
|
static int acpi_bind_one(struct device *dev, acpi_handle handle)
|
||||||
{
|
{
|
||||||
struct acpi_device *acpi_dev;
|
struct acpi_device *acpi_dev;
|
||||||
|
@@ -365,7 +365,6 @@ struct acpi_bus_type {
|
|||||||
int register_acpi_bus_type(struct acpi_bus_type *);
|
int register_acpi_bus_type(struct acpi_bus_type *);
|
||||||
int unregister_acpi_bus_type(struct acpi_bus_type *);
|
int unregister_acpi_bus_type(struct acpi_bus_type *);
|
||||||
struct device *acpi_get_physical_device(acpi_handle);
|
struct device *acpi_get_physical_device(acpi_handle);
|
||||||
struct device *acpi_get_physical_pci_device(acpi_handle);
|
|
||||||
|
|
||||||
/* helper */
|
/* helper */
|
||||||
acpi_handle acpi_get_child(acpi_handle, acpi_integer);
|
acpi_handle acpi_get_child(acpi_handle, acpi_integer);
|
||||||
|
Reference in New Issue
Block a user