backports: include: introduce backport for ACPI_COMPANION() macro
PATCH 1/1 backports: include: introduce backport for ACPI_COMPANION() macro
The brcmfmac driver now uses the ACPI_COMPANION() macro which was introduced in v3.13 kernel. This provides a backport of that macro for older kernels.
Signed-off-by Arend van Spriel <[email protected]>
---
Not sure if this correctly does conversion from ACPI handle to acpi_device.
Regards,
Arend
--- backport/backport-include/linux/acpi.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
backport/backport-include/linux/acpi.h +18 -0
@@ -36,4 +36,22 @@#endif /* CONFIG_ACPI */ #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0) */ +#if LINUX_VERSION_CODE <KERNEL_VERSION (3 ,13 ,0 ) +#ifdef CONFIG_ACPI +static inline struct acpi_device *_acpi_get_companion (struct device *dev) +{ +struct acpi_device *adev; +int ret; + + ret =acpi_bus_get_device (ACPI_HANDLE (dev), &adev); +if (ret <0 ) + adev =NULL ; + +return adev; +} +#define ACPI_COMPANION (dev) _acpi_get_companion(dev) +#else +#define ACPI_COMPANION (dev) (NULL) +#endif /* CONFIG_ACPI */ +#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0) */ #endif /* __BACKPORT_LINUX_ACPI_H */
Signature · 1 line
1.9.1
Quoted 5 lines · Arend van Spriel
The brcmfmac driver now uses the
ACPI_COMPANION()macro which was introduced in v3.13 kernel. This provides a backport of that macro for older kernels.Signed-off-by Arend van Spriel <[email protected]>
Thanks Arend, applied and pushed!
Luis