summaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86/thinkpad_acpi.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2022-01-26 20:38:27 +0100
committerHans de Goede <hdegoede@redhat.com>2022-02-03 11:55:57 +0100
commitf7e62c5890f08543e7b4d305c4b4501f89aafe61 (patch)
tree0c3aee43bc26db1bc3b13cf3146831633cef5dff /drivers/platform/x86/thinkpad_acpi.c
parente9b0e120d02abb45fe03e10d8a54828ceb92514e (diff)
downloadlinux-stable-f7e62c5890f08543e7b4d305c4b4501f89aafe61.tar.gz
linux-stable-f7e62c5890f08543e7b4d305c4b4501f89aafe61.tar.bz2
linux-stable-f7e62c5890f08543e7b4d305c4b4501f89aafe61.zip
platform/x86: Replace acpi_bus_get_device()
Replace acpi_bus_get_device() that is going to be dropped with acpi_fetch_acpi_dev(). No intentional functional impact. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://lore.kernel.org/r/2631712.mvXUDI8C0e@kreacher Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'drivers/platform/x86/thinkpad_acpi.c')
-rw-r--r--drivers/platform/x86/thinkpad_acpi.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index 3424b080db77..e9b1574729b9 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -728,11 +728,10 @@ static void __init drv_acpi_handle_init(const char *name,
static acpi_status __init tpacpi_acpi_handle_locate_callback(acpi_handle handle,
u32 level, void *context, void **return_value)
{
- struct acpi_device *dev;
if (!strcmp(context, "video")) {
- if (acpi_bus_get_device(handle, &dev))
- return AE_OK;
- if (strcmp(ACPI_VIDEO_HID, acpi_device_hid(dev)))
+ struct acpi_device *dev = acpi_fetch_acpi_dev(handle);
+
+ if (!dev || strcmp(ACPI_VIDEO_HID, acpi_device_hid(dev)))
return AE_OK;
}
@@ -786,7 +785,6 @@ static void dispatch_acpi_notify(acpi_handle handle, u32 event, void *data)
static int __init setup_acpi_notify(struct ibm_struct *ibm)
{
acpi_status status;
- int rc;
BUG_ON(!ibm->acpi);
@@ -796,9 +794,9 @@ static int __init setup_acpi_notify(struct ibm_struct *ibm)
vdbg_printk(TPACPI_DBG_INIT,
"setting up ACPI notify for %s\n", ibm->name);
- rc = acpi_bus_get_device(*ibm->acpi->handle, &ibm->acpi->device);
- if (rc < 0) {
- pr_err("acpi_bus_get_device(%s) failed: %d\n", ibm->name, rc);
+ ibm->acpi->device = acpi_fetch_acpi_dev(*ibm->acpi->handle);
+ if (!ibm->acpi->device) {
+ pr_err("acpi_fetch_acpi_dev(%s) failed\n", ibm->name);
return -ENODEV;
}
@@ -6723,7 +6721,8 @@ static int __init tpacpi_query_bcl_levels(acpi_handle handle)
struct acpi_device *device, *child;
int rc;
- if (acpi_bus_get_device(handle, &device))
+ device = acpi_fetch_acpi_dev(handle);
+ if (!device)
return 0;
rc = 0;