ACPI / dock: Pass ACPI device pointer to acpi_device_is_battery()

Since we already know what the device's PNP IDs are when
acpi_device_is_battery() is called, it is not necessary to run
acpi_get_object_info() for the device in that function.  Instead, if
acpi_device_is_battery() is passed a pointer to a struct acpi_device
object, it can use the list of PNP IDs from that object, so make that
happen and modify the function's header accordingly

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
Rafael J. Wysocki
2014-02-16 00:09:34 +01:00
rodzic 1e2380cd14
commit b43109fa46
3 zmienionych plików z 13 dodań i 15 usunięć

Wyświetl plik

@@ -793,7 +793,7 @@ void acpi_dock_add(struct acpi_device *adev)
dock_station->flags |= DOCK_IS_DOCK;
if (acpi_ata_match(handle))
dock_station->flags |= DOCK_IS_ATA;
if (acpi_device_is_battery(handle))
if (acpi_device_is_battery(adev))
dock_station->flags |= DOCK_IS_BAT;
ret = sysfs_create_group(&dd->dev.kobj, &dock_attribute_group);