summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArvind Yadav <arvind.yadav.cs@gmail.com>2017-11-11 23:39:18 +0530
committerJassi Brar <jaswinder.singh@linaro.org>2017-11-14 20:21:35 +0530
commit1f90a2162fb3cdfd9c44380bf16209af00f7acbe (patch)
tree563b2b8cdeaee25dd60592c3c70a2a7b44c69752
parente339c80af95e14de3712d69ddea09a3868fa14cd (diff)
mailbox/omap: unregister mbox class
platform_driver_register() can fail here and we must unregister mbox class. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Acked-by: Suman Anna <s-anna@ti.com> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
-rw-r--r--drivers/mailbox/omap-mailbox.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/mailbox/omap-mailbox.c b/drivers/mailbox/omap-mailbox.c
index c5e8b9cb170d..2517038a8452 100644
--- a/drivers/mailbox/omap-mailbox.c
+++ b/drivers/mailbox/omap-mailbox.c
@@ -906,7 +906,11 @@ static int __init omap_mbox_init(void)
mbox_kfifo_size = max_t(unsigned int, mbox_kfifo_size,
sizeof(mbox_msg_t));
- return platform_driver_register(&omap_mbox_driver);
+ err = platform_driver_register(&omap_mbox_driver);
+ if (err)
+ class_unregister(&omap_mbox_class);
+
+ return err;
}
subsys_initcall(omap_mbox_init);