summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorCristian Marussi <cristian.marussi@arm.com>2021-03-16 13:49:02 +0100
committerSudeep Holla <sudeep.holla@arm.com>2021-03-30 17:35:16 +0200
commitf5800e0bf6f9b7ff7dfa4db8b0681bd062eb16a4 (patch)
treeb8f74aaac9f4698e36c7b6a66edaf9312a2c8f62 /include
parentfirmware: arm_scmi: Rename non devres notify_ops (diff)
downloadlinux-f5800e0bf6f9b7ff7dfa4db8b0681bd062eb16a4.tar.xz
linux-f5800e0bf6f9b7ff7dfa4db8b0681bd062eb16a4.zip
firmware: arm_scmi: Add protocol modularization support
Extend SCMI protocols accounting mechanism to address possible module usage and add the support to possibly define new protocols as loadable modules. Keep the standard protocols built into the SCMI core. Link: https://lore.kernel.org/r/20210316124903.35011-38-cristian.marussi@arm.com Tested-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Cristian Marussi <cristian.marussi@arm.com> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/scmi_protocol.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/scmi_protocol.h b/include/linux/scmi_protocol.h
index b80496d519f3..79d0a1237e6c 100644
--- a/include/linux/scmi_protocol.h
+++ b/include/linux/scmi_protocol.h
@@ -704,6 +704,18 @@ static inline void scmi_driver_unregister(struct scmi_driver *driver) {}
#define module_scmi_driver(__scmi_driver) \
module_driver(__scmi_driver, scmi_register, scmi_unregister)
+/**
+ * module_scmi_protocol() - Helper macro for registering a scmi protocol
+ * @__scmi_protocol: scmi_protocol structure
+ *
+ * Helper macro for scmi drivers to set up proper module init / exit
+ * functions. Replaces module_init() and module_exit() and keeps people from
+ * printing pointless things to the kernel log when their driver is loaded.
+ */
+#define module_scmi_protocol(__scmi_protocol) \
+ module_driver(__scmi_protocol, \
+ scmi_protocol_register, scmi_protocol_unregister)
+
struct scmi_protocol;
int scmi_protocol_register(const struct scmi_protocol *proto);
void scmi_protocol_unregister(const struct scmi_protocol *proto);