summaryrefslogtreecommitdiff
path: root/include/linux/mailbox_controller.h
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2018-12-20 20:19:44 +0300
committerJassi Brar <jaswinder.singh@linaro.org>2018-12-22 01:49:25 +0300
commite898d9cdd3a9f105863d63dd3b46443742a4757c (patch)
tree48a3a80b84cc3a18b1589454d129c8b70cf18841 /include/linux/mailbox_controller.h
parente2affdbef2aca880f4b9e758779c72540db5f168 (diff)
downloadlinux-e898d9cdd3a9f105863d63dd3b46443742a4757c.tar.xz
mailbox: Add device-managed registration functions
Add device-managed equivalents of the mbox_controller_register() and mbox_controller_unregister() functions that can be used to have the devres infrastructure automatically unregister mailbox controllers on driver probe failure or driver removal. This can help remove a lot of boiler plate code from drivers. Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Reviewed-by: Sudeep Holla <sudeep.holla@arm.com> Signed-off-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
Diffstat (limited to 'include/linux/mailbox_controller.h')
-rw-r--r--include/linux/mailbox_controller.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/mailbox_controller.h b/include/linux/mailbox_controller.h
index 74deadb42d76..9b0b21207345 100644
--- a/include/linux/mailbox_controller.h
+++ b/include/linux/mailbox_controller.h
@@ -131,4 +131,9 @@ void mbox_controller_unregister(struct mbox_controller *mbox); /* can sleep */
void mbox_chan_received_data(struct mbox_chan *chan, void *data); /* atomic */
void mbox_chan_txdone(struct mbox_chan *chan, int r); /* atomic */
+int devm_mbox_controller_register(struct device *dev,
+ struct mbox_controller *mbox);
+void devm_mbox_controller_unregister(struct device *dev,
+ struct mbox_controller *mbox);
+
#endif /* __MAILBOX_CONTROLLER_H */