[PATCH 08/21] header: backport devm_acpi_dev_add_driver_gpios()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


This is used by some NFC drivers to get information from the ACPI.
This was added in kernel 4.13, but backporting it to older kernel
versions than 3.19 is hard because such old kernel versions do not even
have struct acpi_gpio_mapping. This only adds the empty version of this
function as this normally needed some extra support in the generic ACPI
code and I do not care about this functionality.

Signed-off-by: Hauke Mehrtens <hauke@xxxxxxxxxx>
 backport/backport-include/linux/acpi.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/backport/backport-include/linux/acpi.h b/backport/backport-include/linux/acpi.h
index c63648b6..fe183626 100644
--- a/backport/backport-include/linux/acpi.h
+++ b/backport/backport-include/linux/acpi.h
@@ -60,4 +60,13 @@ static inline struct acpi_device *_acpi_get_companion(struct device *dev)
 static inline void acpi_dev_remove_driver_gpios(struct acpi_device *adev) {}
 #endif /* LINUX_VERSION_IS_LESS(3, 19, 0) */
+#if LINUX_VERSION_IN_RANGE(3,19,0, 4,13,0)
+#define devm_acpi_dev_add_driver_gpios LINUX_BACKPORT(devm_acpi_dev_add_driver_gpios)
+static inline int devm_acpi_dev_add_driver_gpios(struct device *dev,
+			      const struct acpi_gpio_mapping *gpios)
+	return -ENXIO;
+#endif /* LINUX_VERSION_IN_RANGE(4,19,0, 4,13,0) */
 #endif /* __BACKPORT_LINUX_ACPI_H */

To unsubscribe from this list: send the line "unsubscribe backports" in

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux