From 09f1d2bb4d5d695d868d30ec36bdd4eae11224ec Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sat, 15 Jun 2013 12:19:57 +0200 Subject: [PATCH] backports: add module_spi_driver module_spi_driver was added in the following commit to mainline: commit 3acbb0142d48713a8f65cde678a54f419801c189 Author: Lars-Peter Clausen Date: Wed Nov 16 10:13:37 2011 +0100 SPI: Add helper macro for spi_driver boilerplate Signed-off-by: Hauke Mehrtens --- 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 000000000000..672cf5b09b35 --- /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 + +#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 */ -- 2.30.2