linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mailbox/omap: unregister mbox class
@ 2017-11-11 18:09 Arvind Yadav
  2017-11-13 16:28 ` Suman Anna
  0 siblings, 1 reply; 2+ messages in thread
From: Arvind Yadav @ 2017-11-11 18:09 UTC (permalink / raw)
  To: jassisinghbrar, s-anna; +Cc: linux-kernel, linux-pm

platform_driver_register() can fail here and we must unregister mbox
class.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
 drivers/mailbox/omap-mailbox.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/mailbox/omap-mailbox.c b/drivers/mailbox/omap-mailbox.c
index c5e8b9c..2517038 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);
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mailbox/omap: unregister mbox class
  2017-11-11 18:09 [PATCH] mailbox/omap: unregister mbox class Arvind Yadav
@ 2017-11-13 16:28 ` Suman Anna
  0 siblings, 0 replies; 2+ messages in thread
From: Suman Anna @ 2017-11-13 16:28 UTC (permalink / raw)
  To: Arvind Yadav, jassisinghbrar; +Cc: linux-kernel, linux-pm

On 11/11/2017 12:09 PM, Arvind Yadav wrote:
> 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>

regards
Suman

> ---
>  drivers/mailbox/omap-mailbox.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mailbox/omap-mailbox.c b/drivers/mailbox/omap-mailbox.c
> index c5e8b9c..2517038 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);
>  
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-11-13 16:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-11 18:09 [PATCH] mailbox/omap: unregister mbox class Arvind Yadav
2017-11-13 16:28 ` Suman Anna

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).