Skip to content

Commit

Permalink
mailbox/omap: unregister mbox class
Browse files Browse the repository at this point in the history
platform_driver_register() can fail here and we must unregister mbox
class.

Signed-off-by: Arvind Yadav <[email protected]>
Acked-by: Suman Anna <[email protected]>
Signed-off-by: Jassi Brar <[email protected]>
  • Loading branch information
ArvindYadavCs authored and JassiBrar committed Nov 14, 2017
1 parent e339c80 commit 1f90a21
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/mailbox/omap-mailbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 1f90a21

Please sign in to comment.