Skip to content

Commit 9837895

Browse files
committed
ACPI: property: Use acpi_dev_parent()
After introducing acpi_dev_parent() in commit 62fcb99 ("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>
1 parent e3b9b27 commit 9837895

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/acpi/property.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1270,10 +1270,11 @@ acpi_node_get_parent(const struct fwnode_handle *fwnode)
12701270
return to_acpi_data_node(fwnode)->parent;
12711271
}
12721272
if (is_acpi_device_node(fwnode)) {
1273-
struct device *dev = to_acpi_device_node(fwnode)->dev.parent;
1273+
struct acpi_device *parent;
12741274

1275-
if (dev)
1276-
return acpi_fwnode_handle(to_acpi_device(dev));
1275+
parent = acpi_dev_parent(to_acpi_device_node(fwnode));
1276+
if (parent)
1277+
return acpi_fwnode_handle(parent);
12771278
}
12781279

12791280
return NULL;

0 commit comments

Comments
 (0)