# \[PATCH v2 05/22\] ACPI: add acpi\_dev\_get\_device()

- From: Rob Herring \<hidden\>
- Date: 2015-07-30 03:08:32 
- List: linux-arm-kernel
- Page: https://ratatoskr.run/linux-arm-kernel/2015/07/4546377
- Thread: https://ratatoskr.run/linux-arm-kernel/2015/07/4544884/t.md

```text
On Tue, Jul 28, 2015 at 8:19 AM, Tomeu Vizoso
[ref] wrote:
> This function is just a getter for struct acpi_device.dev and is needed
> in the implementation of the fwnode API when building with !CONFIG_ACPI.
>
> Signed-off-by: Tomeu Vizoso <redacted>
> ---
>
> Changes in v2:
> - Add acpi_dev_get_device()
>
>  include/linux/acpi.h | 10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> diff --git a/include/linux/acpi.h b/include/linux/acpi.h
> index 01e6770d8e27..d1ad6c20c7e4 100644
> --- a/include/linux/acpi.h
> +++ b/include/linux/acpi.h
> @@ -78,6 +78,11 @@ static inline void acpi_preset_companion(struct device *dev,
>         ACPI_COMPANION_SET(dev, acpi_find_child_device(parent, addr, NULL));
>  }
>
> +static inline struct device *acpi_dev_get_device(struct acpi_device *adev)

get usually implies reference counting. Perhaps acpi_dev_to_device or
acpi_dev_find_device.

Rob
```
