diff options
-rw-r--r-- | drivers/acpi/scan.c | 1 | ||||
-rw-r--r-- | drivers/hwmon/acpi_power_meter.c | 13 |
2 files changed, 6 insertions, 8 deletions
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 5b54c80b9d32..f456ba7c1060 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -608,6 +608,7 @@ struct acpi_device *acpi_bus_get_acpi_device(acpi_handle handle) { return handle_to_device(handle, get_acpi_device); } +EXPORT_SYMBOL_GPL(acpi_bus_get_acpi_device); static struct acpi_device_bus_id *acpi_device_bus_id_match(const char *dev_id) { diff --git a/drivers/hwmon/acpi_power_meter.c b/drivers/hwmon/acpi_power_meter.c index 014505b1faf7..c405a5869581 100644 --- a/drivers/hwmon/acpi_power_meter.c +++ b/drivers/hwmon/acpi_power_meter.c @@ -535,7 +535,7 @@ static void remove_domain_devices(struct acpi_power_meter_resource *resource) sysfs_remove_link(resource->holders_dir, kobject_name(&obj->dev.kobj)); - put_device(&obj->dev); + acpi_dev_put(obj); } kfree(resource->domain_devices); @@ -597,18 +597,15 @@ static int read_domain_devices(struct acpi_power_meter_resource *resource) continue; /* Create a symlink to domain objects */ - resource->domain_devices[i] = NULL; - if (acpi_bus_get_device(element->reference.handle, - &resource->domain_devices[i])) + obj = acpi_bus_get_acpi_device(element->reference.handle); + resource->domain_devices[i] = obj; + if (!obj) continue; - obj = resource->domain_devices[i]; - get_device(&obj->dev); - res = sysfs_create_link(resource->holders_dir, &obj->dev.kobj, kobject_name(&obj->dev.kobj)); if (res) { - put_device(&obj->dev); + acpi_dev_put(obj); resource->domain_devices[i] = NULL; } } |