public inbox for linux-remoteproc@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drivers: rpmsg: class_destroy() is deprecated
@ 2026-03-08 14:08 Jori Koolstra
  2026-03-08 14:22 ` Greg KH
  2026-03-09 14:37 ` Mathieu Poirier
  0 siblings, 2 replies; 3+ messages in thread
From: Jori Koolstra @ 2026-03-08 14:08 UTC (permalink / raw)
  To: gregkh, Bjorn Andersson, Mathieu Poirier
  Cc: Jori Koolstra,
	open list:REMOTE PROCESSOR MESSAGING (RPMSG) SUBSYSTEM, open list

The class_destroy() function documents that:

  Note, the pointer to be destroyed must have been created with a call
  to class_create().

However, class_create() is deprecated. rpmsg already uses
class_register() but the class_destroy() calls should also be replaced
with class_unregister().

Link: https://lore.kernel.org/all/2023040244-duffel-pushpin-f738@gregkh/
Signed-off-by: Jori Koolstra <jkoolstra@xs4all.nl>
---
 drivers/rpmsg/rpmsg_core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/rpmsg/rpmsg_core.c b/drivers/rpmsg/rpmsg_core.c
index 96964745065b..948541656950 100644
--- a/drivers/rpmsg/rpmsg_core.c
+++ b/drivers/rpmsg/rpmsg_core.c
@@ -650,7 +650,7 @@ static int __init rpmsg_init(void)
 	ret = bus_register(&rpmsg_bus);
 	if (ret) {
 		pr_err("failed to register rpmsg bus: %d\n", ret);
-		class_destroy(&rpmsg_class);
+		class_unregister(&rpmsg_class);
 	}
 	return ret;
 }
@@ -659,7 +659,7 @@ postcore_initcall(rpmsg_init);
 static void __exit rpmsg_fini(void)
 {
 	bus_unregister(&rpmsg_bus);
-	class_destroy(&rpmsg_class);
+	class_unregister(&rpmsg_class);
 }
 module_exit(rpmsg_fini);
 

base-commit: d466c332e106fe666d1e2f5a24d08e308bebbfa1
-- 
2.53.0


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

* Re: [PATCH] drivers: rpmsg: class_destroy() is deprecated
  2026-03-08 14:08 [PATCH] drivers: rpmsg: class_destroy() is deprecated Jori Koolstra
@ 2026-03-08 14:22 ` Greg KH
  2026-03-09 14:37 ` Mathieu Poirier
  1 sibling, 0 replies; 3+ messages in thread
From: Greg KH @ 2026-03-08 14:22 UTC (permalink / raw)
  To: Jori Koolstra
  Cc: Bjorn Andersson, Mathieu Poirier,
	open list:REMOTE PROCESSOR MESSAGING (RPMSG) SUBSYSTEM, open list

On Sun, Mar 08, 2026 at 03:08:49PM +0100, Jori Koolstra wrote:
> The class_destroy() function documents that:
> 
>   Note, the pointer to be destroyed must have been created with a call
>   to class_create().
> 
> However, class_create() is deprecated. rpmsg already uses
> class_register() but the class_destroy() calls should also be replaced
> with class_unregister().
> 
> Link: https://lore.kernel.org/all/2023040244-duffel-pushpin-f738@gregkh/
> Signed-off-by: Jori Koolstra <jkoolstra@xs4all.nl>
> ---
>  drivers/rpmsg/rpmsg_core.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

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

* Re: [PATCH] drivers: rpmsg: class_destroy() is deprecated
  2026-03-08 14:08 [PATCH] drivers: rpmsg: class_destroy() is deprecated Jori Koolstra
  2026-03-08 14:22 ` Greg KH
@ 2026-03-09 14:37 ` Mathieu Poirier
  1 sibling, 0 replies; 3+ messages in thread
From: Mathieu Poirier @ 2026-03-09 14:37 UTC (permalink / raw)
  To: Jori Koolstra
  Cc: gregkh, Bjorn Andersson,
	open list:REMOTE PROCESSOR MESSAGING (RPMSG) SUBSYSTEM, open list

On Sun, Mar 08, 2026 at 03:08:49PM +0100, Jori Koolstra wrote:
> The class_destroy() function documents that:
> 
>   Note, the pointer to be destroyed must have been created with a call
>   to class_create().
> 
> However, class_create() is deprecated. rpmsg already uses
> class_register() but the class_destroy() calls should also be replaced
> with class_unregister().
> 
> Link: https://lore.kernel.org/all/2023040244-duffel-pushpin-f738@gregkh/
> Signed-off-by: Jori Koolstra <jkoolstra@xs4all.nl>
> ---
>  drivers/rpmsg/rpmsg_core.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>

Applied - thanks,
Mathieu
 
> diff --git a/drivers/rpmsg/rpmsg_core.c b/drivers/rpmsg/rpmsg_core.c
> index 96964745065b..948541656950 100644
> --- a/drivers/rpmsg/rpmsg_core.c
> +++ b/drivers/rpmsg/rpmsg_core.c
> @@ -650,7 +650,7 @@ static int __init rpmsg_init(void)
>  	ret = bus_register(&rpmsg_bus);
>  	if (ret) {
>  		pr_err("failed to register rpmsg bus: %d\n", ret);
> -		class_destroy(&rpmsg_class);
> +		class_unregister(&rpmsg_class);
>  	}
>  	return ret;
>  }
> @@ -659,7 +659,7 @@ postcore_initcall(rpmsg_init);
>  static void __exit rpmsg_fini(void)
>  {
>  	bus_unregister(&rpmsg_bus);
> -	class_destroy(&rpmsg_class);
> +	class_unregister(&rpmsg_class);
>  }
>  module_exit(rpmsg_fini);
>  
> 
> base-commit: d466c332e106fe666d1e2f5a24d08e308bebbfa1
> -- 
> 2.53.0
> 

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

end of thread, other threads:[~2026-03-09 14:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-08 14:08 [PATCH] drivers: rpmsg: class_destroy() is deprecated Jori Koolstra
2026-03-08 14:22 ` Greg KH
2026-03-09 14:37 ` Mathieu Poirier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox