diff options
author | Arend van Spriel <arend@broadcom.com> | 2015-05-27 21:15:05 +0200 |
---|---|---|
committer | Luis R. Rodriguez <mcgrof@do-not-panic.com> | 2015-06-09 14:56:32 -0700 |
commit | c6f7e8d29b61595625dedd2f20ceadfe37b6f860 (patch) | |
tree | 1bd0f0bcf473acfabcf5345e16ac5b9e89911944 | |
parent | e9dadfe5f446c9b2b1563ad50daf3a50b4497726 (diff) |
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 <arend@broadcom.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
-rw-r--r-- | backport/backport-include/linux/acpi.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/backport/backport-include/linux/acpi.h b/backport/backport-include/linux/acpi.h index 506df15a..ff55d76e 100644 --- a/backport/backport-include/linux/acpi.h +++ b/backport/backport-include/linux/acpi.h @@ -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 */ |