diff mbox series

[09/30] header: add module_sdio_driver

Message ID 20201201220415.30582-10-hauke@hauke-m.de (mailing list archive)
State New, archived
Headers show
Series backports: Update to match kernel 5.10-rc6 | expand

Commit Message

Hauke Mehrtens Dec. 1, 2020, 10:03 p.m. UTC
The module_sdio_driver define is used by the mt76 driver.
This was added in upstream Linux commit db0a39083520 ("mmc: sdio: Add
helper macro for sdio_driver boilerplate").

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 backport/backport-include/linux/mmc/sdio_func.h | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
diff mbox series

Patch

diff --git a/backport/backport-include/linux/mmc/sdio_func.h b/backport/backport-include/linux/mmc/sdio_func.h
index 0a67f992..7ff926ae 100644
--- a/backport/backport-include/linux/mmc/sdio_func.h
+++ b/backport/backport-include/linux/mmc/sdio_func.h
@@ -83,4 +83,18 @@  static inline void sdio_retune_crc_enable(struct sdio_func *func)
 }
 #endif /* < 5.2 */
 
+#ifndef module_sdio_driver
+/**
+ * module_sdio_driver() - Helper macro for registering a SDIO driver
+ * @__sdio_driver: sdio_driver struct
+ *
+ * Helper macro for SDIO 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_sdio_driver(__sdio_driver) \
+	module_driver(__sdio_driver, sdio_register_driver, \
+		      sdio_unregister_driver)
+#endif
+
 #endif /* __BACKPORT_MMC_SDIO_FUNC_H */