Re: [PATCH v2 2/5] rust: Add bindings for reading device properties

Danilo Krummrich
2025-04-14T18:05:35Z

On Mon, Apr 14, 2025 at 07:44:36PM +0200, Danilo Krummrich wrote:
> On Mon, Apr 14, 2025 at 05:26:27PM +0200, Remo Senekowitsch wrote:
> > The device property API is a firmware agnostic API for reading
> > properties from firmware (DT/ACPI) devices nodes and swnodes.
> >
> > While the C API takes a pointer to a caller allocated variable/buffer,
> > the rust API is designed to return a value and can be used in struct
> > initialization. Rust generics are also utilized to support different
> > types of properties where appropriate.
> >
> > The PropertyGuard is a way to force users to specify whether a property
> > is supposed to be required or not. This allows us to move error
> > logging of missing required properties into core, preventing a lot of
> > boilerplate in drivers.
>
> The patch adds a lot of thing, i.e.
> * implement PropertyInt

I meant the Property trait and all its impls of course. :)

> * implement PropertyGuard
> * extend FwNode by a lot of functions
> * extend Device by some property functions