lkml.org 
[lkml]   [2022]   [Aug]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2 5/5] ACPI: Drop parent field from struct acpi_device
From
Date
Hi Rafael,

On 2022/8/25 0:59, Rafael J. Wysocki wrote:
> Index: linux-pm/include/acpi/acpi_bus.h
> ===================================================================
> --- linux-pm.orig/include/acpi/acpi_bus.h
> +++ linux-pm/include/acpi/acpi_bus.h
> @@ -365,7 +365,6 @@ struct acpi_device {
> int device_type;
> acpi_handle handle; /* no handle for fixed hardware */
> struct fwnode_handle fwnode;
> - struct acpi_device *parent;
> struct list_head wakeup_list;
> struct list_head del_list;
> struct acpi_device_status status;
> @@ -458,6 +457,14 @@ static inline void *acpi_driver_data(str
> #define to_acpi_device(d) container_of(d, struct acpi_device, dev)
> #define to_acpi_driver(d) container_of(d, struct acpi_driver, drv)
>
> +static inline struct acpi_device *acpi_dev_parent(struct acpi_device *adev)
> +{
> + if (adev->dev.parent)
> + return to_acpi_device(adev->dev.parent);
> +
> + return NULL;
> +}
> +
> static inline void acpi_set_device_status(struct acpi_device *adev, u32 sta)
> {
> *((u32 *)&adev->status) = sta;
> @@ -478,6 +485,7 @@ void acpi_initialize_hp_context(struct a
> /* acpi_device.dev.bus == &acpi_bus_type */
> extern struct bus_type acpi_bus_type;
>
> +struct acpi_device *acpi_dev_parent(struct acpi_device *adev);

We have a static inline function above, is it duplicated here?
Or did I miss some use cases?

Thanks
Hanjun

\
 
 \ /
  Last update: 2022-08-27 15:21    [W:0.105 / U:0.968 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site