[PATCH 6/8] backports: add module_spi_driver

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

 



module_spi_driver was added in the following commit to mainline:
commit 3acbb0142d48713a8f65cde678a54f419801c189
Author: Lars-Peter Clausen <lars@xxxxxxxxxx>
Date:   Wed Nov 16 10:13:37 2011 +0100

    SPI: Add helper macro for spi_driver boilerplate

Signed-off-by: Hauke Mehrtens <hauke@xxxxxxxxxx>
---
 backport/backport-include/linux/spi/spi.h |   20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100644 backport/backport-include/linux/spi/spi.h

diff --git a/backport/backport-include/linux/spi/spi.h b/backport/backport-include/linux/spi/spi.h
new file mode 100644
index 0000000..672cf5b
--- /dev/null
+++ b/backport/backport-include/linux/spi/spi.h
@@ -0,0 +1,20 @@
+#ifndef _BACKPORTS_LINUX_SPI_H
+#define _BACKPORTS_LINUX_SPI_H 1
+
+#include_next <linux/spi/spi.h>
+
+#ifndef module_spi_driver
+/**
+ * module_spi_driver() - Helper macro for registering a SPI driver
+ * @__spi_driver: spi_driver struct
+ *
+ * Helper macro for SPI drivers which do not do anything special in module
+ * init/exit. This eliminates a lot of boilerplate. Each module may only
+ * use this macro once, and calling it replaces module_init() and module_exit()
+ */
+#define module_spi_driver(__spi_driver) \
+	module_driver(__spi_driver, spi_register_driver, \
+			spi_unregister_driver)
+#endif
+
+#endif /* _BACKPORTS_LINUX_SPI_H */
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe backports" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[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