Re: [PATCH v1 3/3] samples: rust: platform: Add property child and reference args examples
From: Danilo Krummrich
Date: Fri Jun 20 2025 - 18:37:45 EST
On Tue, Jun 17, 2025 at 08:01:08AM -0500, Rob Herring wrote:
> On Mon, Jun 16, 2025 at 10:45 AM Remo Senekowitsch <remo@xxxxxxxxxxx> wrote:
> >
> > Add some example usage of the device property methods for reading
> > DT/ACPI/swnode child nodes and reference args.
> >
> > Signed-off-by: Remo Senekowitsch <remo@xxxxxxxxxxx>
> > ---
> > drivers/of/unittest-data/tests-platform.dtsi | 7 +++++++
> > samples/rust/rust_driver_platform.rs | 13 ++++++++++++-
> > 2 files changed, 19 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/of/unittest-data/tests-platform.dtsi b/drivers/of/unittest-data/tests-platform.dtsi
> > index 50a51f38afb6..509eb614ab2b 100644
> > --- a/drivers/of/unittest-data/tests-platform.dtsi
> > +++ b/drivers/of/unittest-data/tests-platform.dtsi
> > @@ -40,6 +40,13 @@ test-device@2 {
> >
> > test,u32-prop = <0xdeadbeef>;
> > test,i16-array = /bits/ 16 <1 2 (-3) (-4)>;
> > +
> > + ref_child_0: child@0 {
>
> child-0 or you need to add 'reg' property if you keep the unit-address.
Adding child nodes here creates the following dt-test failues.
[ 1.031239] ### dt-test ### FAIL of_unittest_platform_populate():1862 Could not create device for node 'child'
[ 1.031647] ### dt-test ### FAIL of_unittest_platform_populate():1862 Could not create device for node 'child'
@Rob: What do you suggest?
>
> > + test,ref-arg = <&ref_child_1 0x20 0x32>;
> > + };
> > + ref_child_1: child@1 {
> > + test,ref-arg = <&ref_child_0 0x10 0x64>;
> > + };
> > };
> > };