summaryrefslogtreecommitdiff
path: root/include/linux/mei_cl_bus.h
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2016-10-19 16:33:27 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-10-28 15:21:21 +0300
commit5be149bdd36c8765c9e785f70b888d028ada40af (patch)
tree1b6997f1125690425a4f0d3b073a31de2c87f8ea /include/linux/mei_cl_bus.h
parent0d18c19288601b66ad2852cceb66ae68972243dc (diff)
downloadlinux-5be149bdd36c8765c9e785f70b888d028ada40af.tar.xz
mei: bus: add module_mei_cl_driver helper macro
Add module_mei_cl_driver helper macro for eliminating the boilerplate code from mei_cl drivers registration. The macro is intended for drivers which in their init/exit sections does only register/unregister of a mei_cl driver. Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/mei_cl_bus.h')
-rw-r--r--include/linux/mei_cl_bus.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/mei_cl_bus.h b/include/linux/mei_cl_bus.h
index e746919530f5..e6fbd98ea90e 100644
--- a/include/linux/mei_cl_bus.h
+++ b/include/linux/mei_cl_bus.h
@@ -74,6 +74,19 @@ int __mei_cldev_driver_register(struct mei_cl_driver *cldrv,
void mei_cldev_driver_unregister(struct mei_cl_driver *cldrv);
+/**
+ * module_mei_cl_driver - Helper macro for registering mei cl driver
+ *
+ * @__mei_cldrv mei_cl_driver structure
+ *
+ * Helper macro for mei cl drivers which do not do anything special in module
+ * init/exit, for eliminating a boilerplate code.
+ */
+#define module_mei_cl_driver(__mei_cldrv) \
+ module_driver(__mei_cldrv, \
+ mei_cldev_driver_register,\
+ mei_cldev_driver_unregister)
+
ssize_t mei_cldev_send(struct mei_cl_device *cldev, u8 *buf, size_t length);
ssize_t mei_cldev_recv(struct mei_cl_device *cldev, u8 *buf, size_t length);