Re: [PATCH] nubus: switch to dynamic root device

Finn Thain
2026-04-25T04:06:58Z

On Fri, 24 Apr 2026, Johan Hovold wrote:

> Driver core expects devices to be dynamically allocated and will, for
> example, complain loudly if a device that lacks a release function is
> ever freed.
>

Yes, in drivers/base/core.c, there is a warning in device_release().

WARN(1, KERN_ERR "Device '%s' does not have a release()
function, it is broken and must be fixed. See
Documentation/core-api/kobject.rst.\n",

But there's no way for the refcount for the nubus parent device to reach
zero that I can see. Did I miss something?

> Use root_device_register() to allocate and register the root device
> instead of open coding using a static device.
>

Well, dynamic allocation makes sense for busses that might be instantiated
more than once. But I don't know of any hardware like that. The nubus
parent device is a singleton.

I suppose I could see some benefit to converting CONFIG_NUBUS into a
tristate. Maybe the module link in root_device_register() would become
applicable if someone wanted to do that conversion.