mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
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>
This commit is contained in:
parent
e2affdbef2
commit
e898d9cdd3
2 changed files with 75 additions and 0 deletions
|
@ -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 */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue