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);
int acpi_bind_one(struct device *dev, struct acpi_device *adev);
int acpi_unbind_one(struct device *dev);
bool acpi_device_is_present(struct acpi_device *adev);
-bool acpi_device_is_battery(acpi_handle handle);
+bool acpi_device_is_battery(struct acpi_device *adev);
/* --------------------------------------------------------------------------
Power Resource
return acpi_ata_match(phandle);
}
-bool acpi_device_is_battery(acpi_handle handle)
+bool acpi_device_is_battery(struct acpi_device *adev)
{
- struct acpi_device_info *info;
- bool ret = false;
-
- if (!ACPI_SUCCESS(acpi_get_object_info(handle, &info)))
- return false;
+ struct acpi_hardware_id *hwid;
- if (info->valid & ACPI_VALID_HID)
- ret = !strcmp("PNP0C0A", info->hardware_id.string);
+ list_for_each_entry(hwid, &adev->pnp.ids, list)
+ if (!strcmp("PNP0C0A", hwid->id))
+ return true;
- kfree(info);
- return ret;
+ return false;
}
-static bool is_ejectable_bay(acpi_handle handle)
+static bool is_ejectable_bay(struct acpi_device *adev)
{
- if (acpi_has_method(handle, "_EJ0") && acpi_device_is_battery(handle))
+ acpi_handle handle = adev->handle;
+
+ if (acpi_has_method(handle, "_EJ0") && acpi_device_is_battery(adev))
return true;
return acpi_bay_match(handle);
{
struct acpi_hardware_id *hwid;
- if (acpi_dock_match(adev->handle) || is_ejectable_bay(adev->handle)) {
+ if (acpi_dock_match(adev->handle) || is_ejectable_bay(adev)) {
acpi_dock_add(adev);
return;
}