Re: [PATCH 2/2] driver core: class: warn if a compatibility class is registered

Greg Kroah-Hartman
2024-09-02T19:20:17Z

On Mon, Sep 02, 2024 at 09:02:17PM +0200, Heiner Kallweit wrote:
> Kernel doc for this function states:
> "Compatibility class are meant as a temporary user-space compatibility
> workaround when converting a family of class devices to a bus devices."
>
> Therefore remind any potential user of the old ABI that support for it
> will be dropped soon.
>
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
> ---
> drivers/base/class.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/base/class.c b/drivers/base/class.c
> index 7b38fdf8e..f12a43736 100644
> --- a/drivers/base/class.c
> +++ b/drivers/base/class.c
> @@ -556,6 +556,9 @@ struct class_compat *class_compat_register(const char *name)
> {
> struct class_compat *cls;
>
> + pr_warn("Compatibility class %s will go away soon, please migrate userspace tools to use bus devices\n",
> + name);

That's not going to do anything except annoy users who have no control
over this, sorry. Please just fix up all of the kernel and then delete
this function.

thanks,

greg k-h