diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2022-08-24 18:59:48 +0200 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2022-08-24 20:55:24 +0200 |
commit | 62fcb99bdf10fed34b4fe6e225489fe4be2d0536 (patch) | |
tree | 21c1d879b4b903631d3c415bb53c08579f11fe97 /drivers/acpi/property.c | |
parent | 6e1850b2f3747942d3813a2fde82f1e46aa593d1 (diff) | |
download | linux-62fcb99bdf10fed34b4fe6e225489fe4be2d0536.tar.gz linux-62fcb99bdf10fed34b4fe6e225489fe4be2d0536.tar.bz2 linux-62fcb99bdf10fed34b4fe6e225489fe4be2d0536.zip |
ACPI: Drop parent field from struct acpi_device
The parent field in struct acpi_device is, in fact, redundant,
because the dev.parent field in it effectively points to the same
object and it is used by the driver core.
Accordingly, the parent field can be dropped from struct acpi_device
and for this purpose define acpi_dev_parent() to retrieve a parent
struct acpi_device pointer from the dev.parent field in struct
acpi_device. Next, update all of the users of the parent field
in struct acpi_device to use acpi_dev_parent() instead of it and
drop it.
While at it, drop the ACPI_IS_ROOT_DEVICE() macro that is only used
in one place in a confusing way.
No intentional functional impact.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Mark Brown <broonie@kernel.org>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Wei Liu <wei.liu@kernel.org>
Reviewed-by: Punit Agrawal <punit.agrawal@bytedance.com>
Diffstat (limited to 'drivers/acpi/property.c')
-rw-r--r-- | drivers/acpi/property.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/acpi/property.c b/drivers/acpi/property.c index 7b3ad8ed2f4e..3dab3ac9c4a1 100644 --- a/drivers/acpi/property.c +++ b/drivers/acpi/property.c @@ -304,8 +304,10 @@ static void acpi_init_of_compatible(struct acpi_device *adev) ret = acpi_dev_get_property(adev, "compatible", ACPI_TYPE_STRING, &of_compatible); if (ret) { - if (adev->parent - && adev->parent->flags.of_compatible_ok) + struct acpi_device *parent; + + parent = acpi_dev_parent(adev); + if (parent && parent->flags.of_compatible_ok) goto out; return; |