Re: [PATCH 1/5] rust: of: add Node type
From: Rob Herring
Date: Mon Aug 17 2026 - 11:21:05 EST
On Mon, Aug 17, 2026 at 01:40:46PM +0200, Albert Esteve wrote:
> Add a Rust abstraction for `struct device_node`, the device
> tree node type.
>
> `Node` wraps `device_node` type pointer and implements
> `AlwaysRefCounted`, allowing owned references to device
> tree nodes to be held. To do so, add C helpers to make
> them always accesible from Rust bindings, independently
> from the configuration.
struct device_node being refcounted is a kconfig option
(CONFIG_OF_DYNAMIC). What happens when that is disabled?
> This abstraction is needed for subsequent patches, in particular
> for creating drm_panel instances from a `const struct device_node`
> pointer argument.
My intent is to make struct device_node opaque. We may never get there
with C code, but please make sure Rust is that way from the start.
Rob