[PATCH RFC 1/3] of: unittest: Add a platform device node for rust platform driver sample

Rob Herring (Arm) posted 3 patches 1 month ago
[PATCH RFC 1/3] of: unittest: Add a platform device node for rust platform driver sample
Posted by Rob Herring (Arm) 1 month ago
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
---
 drivers/of/unittest-data/tests-platform.dtsi | 5 +++++
 samples/rust/rust_driver_platform.rs         | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/of/unittest-data/tests-platform.dtsi b/drivers/of/unittest-data/tests-platform.dtsi
index fa39611071b3..2caaf1c10ee6 100644
--- a/drivers/of/unittest-data/tests-platform.dtsi
+++ b/drivers/of/unittest-data/tests-platform.dtsi
@@ -33,6 +33,11 @@ dev@100 {
 					reg = <0x100>;
 				};
 			};
+
+			test-device@2 {
+				compatible = "test,rust-device";
+				reg = <0x2>;
+			};
 		};
 	};
 };
diff --git a/samples/rust/rust_driver_platform.rs b/samples/rust/rust_driver_platform.rs
index 55caaaa4f216..5cf4a8f86c13 100644
--- a/samples/rust/rust_driver_platform.rs
+++ b/samples/rust/rust_driver_platform.rs
@@ -15,7 +15,7 @@ struct SampleDriver {
     MODULE_OF_TABLE,
     <SampleDriver as platform::Driver>::IdInfo,
     [(
-        of::DeviceId::new(c_str!("redhat,rust-sample-platform-driver")),
+        of::DeviceId::new(c_str!("test,rust-device")),
         Info(42)
     )]
 );

-- 
2.45.2
Re: [PATCH RFC 1/3] of: unittest: Add a platform device node for rust platform driver sample
Posted by Dirk Behme 4 weeks ago
On 25.10.2024 23:05, Rob Herring (Arm) wrote:
> Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
> ---
>   drivers/of/unittest-data/tests-platform.dtsi | 5 +++++
>   samples/rust/rust_driver_platform.rs         | 2 +-
>   2 files changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/of/unittest-data/tests-platform.dtsi b/drivers/of/unittest-data/tests-platform.dtsi
> index fa39611071b3..2caaf1c10ee6 100644
> --- a/drivers/of/unittest-data/tests-platform.dtsi
> +++ b/drivers/of/unittest-data/tests-platform.dtsi
> @@ -33,6 +33,11 @@ dev@100 {
>   					reg = <0x100>;
>   				};
>   			};
> +
> +			test-device@2 {
> +				compatible = "test,rust-device";
> +				reg = <0x2>;
> +			};
>   		};
>   	};
>   };
> diff --git a/samples/rust/rust_driver_platform.rs b/samples/rust/rust_driver_platform.rs
> index 55caaaa4f216..5cf4a8f86c13 100644
> --- a/samples/rust/rust_driver_platform.rs
> +++ b/samples/rust/rust_driver_platform.rs
> @@ -15,7 +15,7 @@ struct SampleDriver {
>       MODULE_OF_TABLE,
>       <SampleDriver as platform::Driver>::IdInfo,
>       [(
> -        of::DeviceId::new(c_str!("redhat,rust-sample-platform-driver")),
> +        of::DeviceId::new(c_str!("test,rust-device")),
>           Info(42)
>       )]
>   );
> 

I'm not sure if parts or all of this should be squashed into Danilo's 
patches. Anyway:

Reviewed-by: Dirk Behme <dirk.behme@de.bosch.com>

Best regards

Dirk