ACPI: Drop parent field from struct acpi_device
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 24 Aug 2022 16:59:48 +0000 (18:59 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 24 Aug 2022 18:55:24 +0000 (20:55 +0200)
commit62fcb99bdf10fed34b4fe6e225489fe4be2d0536
tree21c1d879b4b903631d3c415bb53c08579f11fe97
parent6e1850b2f3747942d3813a2fde82f1e46aa593d1
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>
14 files changed:
drivers/acpi/acpi_amba.c
drivers/acpi/acpi_platform.c
drivers/acpi/acpi_video.c
drivers/acpi/device_pm.c
drivers/acpi/property.c
drivers/acpi/sbs.c
drivers/acpi/sbshc.c
drivers/acpi/scan.c
drivers/hv/vmbus_drv.c
drivers/perf/arm_dsu_pmu.c
drivers/perf/qcom_l3_pmu.c
drivers/spi/spi.c
drivers/thunderbolt/acpi.c
include/acpi/acpi_bus.h