Re: [PATCH 1/5] rust: of: add Node type
Rob Herring <[email protected]>
| Newsgroups | org.kernel.vger.rust-for-linux,org.freedesktop.lists.dri-devel,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
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