From: Rafael J. Wysocki Date: Mon, 29 Aug 2022 16:12:33 +0000 (+0200) Subject: ACPI: property: Use acpi_dev_parent() X-Git-Tag: v6.6.17~6540^2~8^2~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=98378956a407392109817278c6edd464252c7a83;p=platform%2Fkernel%2Flinux-rpi.git 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 Signed-off-by: Rafael J. Wysocki Reviewed-by: Andy Shevchenko --- diff --git a/drivers/acpi/property.c b/drivers/acpi/property.c index 3dab3ac..f7c3848 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;