Re: [PATCH] thermal: change thermal_class to a const struct

From: Greg Kroah-Hartman

Date: Mon Aug 24 2026 - 12:57:08 EST


On Mon, Aug 24, 2026 at 06:09:33PM +0200, Rafael J. Wysocki (Intel) wrote:
> On Tue, Aug 11, 2026 at 8:17 AM Jori Koolstra <jkoolstra@xxxxxxxxx> wrote:
> >
> > The class_create() call has been deprecated in favor of class_register()
> > as the driver core now allows for a struct class to be in read-only
> > memory. Change thermal_class to be a const struct class and drop the
> > class_create() call.
>
> This has been deliberately changed the other way around not too long
> ago, in commit
>
> 34f54003643e thermal/core: Allocate the thermal class dynamically
>
> and it was then argued that it would be better to allocate the class
> dynamically.
>
> You seem to have a differing opinion.
>
> Is there any plan to remove class_create() from the kernel? If there
> isn't, I'd rather stop this back-and-forth dance and leave the code
> as-is.

Yes, class_create() is going away. I didn't notice commit 34f54003643e,
but that's the wrong thing to do here. We should just revert that
instead.

thanks,

greg k-h