diff options
author | Andy Shevchenko <andy.shevchenko@gmail.com> | 2021-04-13 01:23:58 +0300 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2021-04-13 16:41:11 +0300 |
commit | 4cbaba4e3e4a8a00ed90193ae519c52ba01ea756 (patch) | |
tree | b4d7680c20cb13039e270c0d8d4245b55e52761d /drivers/acpi/device_sysfs.c | |
parent | 020505581119d191ee8da478783e2465d7f5fa8e (diff) | |
download | linux-4cbaba4e3e4a8a00ed90193ae519c52ba01ea756.tar.xz |
ACPI: bus: Introduce acpi_dev_get() and reuse it in ACPI code
Introduce acpi_dev_get() to have a symmetrical API with acpi_dev_put()
and reuse both in ACPI code in drivers/acpi/.
While at it, use acpi_bus_put_acpi_device() in one place instead of
the above.
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/device_sysfs.c')
-rw-r--r-- | drivers/acpi/device_sysfs.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/acpi/device_sysfs.c b/drivers/acpi/device_sysfs.c index da4ff2a8b06a..35757c3c1b71 100644 --- a/drivers/acpi/device_sysfs.c +++ b/drivers/acpi/device_sysfs.c @@ -376,12 +376,12 @@ eject_store(struct device *d, struct device_attribute *attr, if (ACPI_FAILURE(status) || !acpi_device->flags.ejectable) return -ENODEV; - get_device(&acpi_device->dev); + acpi_dev_get(acpi_device); status = acpi_hotplug_schedule(acpi_device, ACPI_OST_EC_OSPM_EJECT); if (ACPI_SUCCESS(status)) return count; - put_device(&acpi_device->dev); + acpi_dev_put(acpi_device); acpi_evaluate_ost(acpi_device->handle, ACPI_OST_EC_OSPM_EJECT, ACPI_OST_SC_NON_SPECIFIC_FAILURE, NULL); return status == AE_NO_MEMORY ? -ENOMEM : -EAGAIN; |