diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2022-08-29 19:12:33 +0300 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2022-09-03 21:51:06 +0300 |
commit | 98378956a407392109817278c6edd464252c7a83 (patch) | |
tree | bd8b671d762e3a520b8686de11729e3acb53bd15 /drivers/acpi/property.c | |
parent | e3b9b27865c45c771f95b5dcf70ee8e88b343c75 (diff) | |
download | linux-98378956a407392109817278c6edd464252c7a83.tar.xz |
ACPI: property: Use acpi_dev_parent()
After introducing acpi_dev_parent() in commit 62fcb99bdf10 ("ACPI: Drop
parent field from struct acpi_device"), it is better to use it instead
of accessing the dev.parent field in struct acpi_device directly.
Modify acpi_node_get_parent() accordingly.
Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Diffstat (limited to 'drivers/acpi/property.c')
-rw-r--r-- | drivers/acpi/property.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/acpi/property.c b/drivers/acpi/property.c index 3dab3ac9c4a1..f7c38481f42c 100644 --- a/drivers/acpi/property.c +++ b/drivers/acpi/property.c @@ -1270,10 +1270,11 @@ acpi_node_get_parent(const struct fwnode_handle *fwnode) return to_acpi_data_node(fwnode)->parent; } if (is_acpi_device_node(fwnode)) { - struct device *dev = to_acpi_device_node(fwnode)->dev.parent; + struct acpi_device *parent; - if (dev) - return acpi_fwnode_handle(to_acpi_device(dev)); + parent = acpi_dev_parent(to_acpi_device_node(fwnode)); + if (parent) + return acpi_fwnode_handle(parent); } return NULL; |