public inbox for linux-m68k@lists.linux-m68k.org
 help / color / mirror / Atom feed
From: Finn Thain <fthain@linux-m68k.org>
To: Johan Hovold <johan@kernel.org>
Cc: linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] nubus: switch to dynamic root device
Date: Sat, 25 Apr 2026 14:07:10 +1000 (AEST)	[thread overview]
Message-ID: <92e2b920-041a-78a4-e4b6-c5a7c579ade7@linux-m68k.org> (raw)
In-Reply-To: <20260424104011.2616970-1-johan@kernel.org>


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.

  reply	other threads:[~2026-04-25  4:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-24 10:40 [PATCH] nubus: switch to dynamic root device Johan Hovold
2026-04-25  4:07 ` Finn Thain [this message]
2026-04-27 15:30   ` Johan Hovold
2026-04-28  7:24     ` Finn Thain
2026-05-04 10:03       ` Johan Hovold
2026-05-04 23:39         ` Finn Thain
2026-05-04  7:41 ` Geert Uytterhoeven

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=92e2b920-041a-78a4-e4b6-c5a7c579ade7@linux-m68k.org \
    --to=fthain@linux-m68k.org \
    --cc=johan@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@lists.linux-m68k.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox