lkml.org 
[lkml]   [2026]   [Apr]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] nubus: switch to dynamic root device

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.

\
 
 \ /
  Last update: 2026-04-25 06:08    [from the cache]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and my Meterkast|Read the blog