Re: [PATCH 1/3] driver core: Require explicit initialization of class and bus_type name
From: Johan Hovold
Date: Tue Dec 01 2026 - 03:26:36 EST
On Mon, Nov 30, 2026 at 02:53:38PM -0800, Ian Rogers wrote:
> class_register() and bus_register() pass .name to kobject_set_name() to
> register the subsystem kset in sysfs, which fails with -ENOMEM if .name
> is NULL.
>
> Annotate .name on struct class and struct bus_type with __must_init so
> missing names are caught at compile time.
I don't see the point in doing this as any superficial testing
(i.e. registering the bus or class) will catch this.
Johan