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 15:41:11 +0200 |
commit | 4cbaba4e3e4a8a00ed90193ae519c52ba01ea756 (patch) | |
tree | b4d7680c20cb13039e270c0d8d4245b55e52761d /drivers/acpi/glue.c | |
parent | 020505581119d191ee8da478783e2465d7f5fa8e (diff) | |
download | lwn-4cbaba4e3e4a8a00ed90193ae519c52ba01ea756.tar.gz lwn-4cbaba4e3e4a8a00ed90193ae519c52ba01ea756.zip |
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/glue.c')
-rw-r--r-- | drivers/acpi/glue.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/acpi/glue.c b/drivers/acpi/glue.c index 36b24b0658cb..0715e3be99a0 100644 --- a/drivers/acpi/glue.c +++ b/drivers/acpi/glue.c @@ -190,7 +190,7 @@ int acpi_bind_one(struct device *dev, struct acpi_device *acpi_dev) if (!acpi_dev) return -EINVAL; - get_device(&acpi_dev->dev); + acpi_dev_get(acpi_dev); get_device(dev); physical_node = kzalloc(sizeof(*physical_node), GFP_KERNEL); if (!physical_node) { @@ -217,7 +217,7 @@ int acpi_bind_one(struct device *dev, struct acpi_device *acpi_dev) goto err; put_device(dev); - put_device(&acpi_dev->dev); + acpi_dev_put(acpi_dev); return 0; } if (pn->node_id == node_id) { @@ -257,7 +257,7 @@ int acpi_bind_one(struct device *dev, struct acpi_device *acpi_dev) err: ACPI_COMPANION_SET(dev, NULL); put_device(dev); - put_device(&acpi_dev->dev); + acpi_dev_put(acpi_dev); return retval; } EXPORT_SYMBOL_GPL(acpi_bind_one); @@ -285,7 +285,7 @@ int acpi_unbind_one(struct device *dev) ACPI_COMPANION_SET(dev, NULL); /* Drop references taken by acpi_bind_one(). */ put_device(dev); - put_device(&acpi_dev->dev); + acpi_dev_put(acpi_dev); kfree(entry); break; } |