summaryrefslogtreecommitdiff
path: root/include/linux/siox.h
diff options
context:
space:
mode:
authorEnrico Weigelt <info@metux.net>2019-06-24 08:40:33 +0300
committerLinus Walleij <linus.walleij@linaro.org>2019-06-27 17:56:51 +0300
commit8f3fd89593377d15df88ad26dcf48318d8c9896f (patch)
tree43265c5b2b9e0dd3b97d5761db3f206fdd7a4f35 /include/linux/siox.h
parent0f5cb8cc27a266c81e6523b436479802e9aafc9e (diff)
downloadlinux-8f3fd89593377d15df88ad26dcf48318d8c9896f.tar.xz
siox: Add helper macro to simplify driver registration
Add more helper macros for trivial driver init cases, similar to the already existing module_platform_driver() or module_i2c_driver(). This helps to reduce driver init boilerplate. Signed-off-by: Enrico Weigelt <info@metux.net> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'include/linux/siox.h')
-rw-r--r--include/linux/siox.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/siox.h b/include/linux/siox.h
index d79624e83134..21d770078540 100644
--- a/include/linux/siox.h
+++ b/include/linux/siox.h
@@ -75,3 +75,13 @@ static inline void siox_driver_unregister(struct siox_driver *sdriver)
{
return driver_unregister(&sdriver->driver);
}
+
+/*
+ * module_siox_driver() - Helper macro for drivers that don't 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_siox_driver(__siox_driver) \
+ module_driver(__siox_driver, siox_driver_register, \
+ siox_driver_unregister)