Re: [PATCH v5 14/16] rust: platform: add basic platform device / driver abstractions

Rob Herring
2024-12-11T15:27:06Z

On Tue, Dec 10, 2024 at 11:46:41PM +0100, Danilo Krummrich wrote:
> Implement the basic platform bus abstractions required to write a basic
> platform driver. This includes the following data structures:
>
> The `platform::Driver` trait represents the interface to the driver and
> provides `platform::Driver::probe` for the driver to implement.
>
> The `platform::Device` abstraction represents a `struct platform_device`.
>
> In order to provide the platform bus specific parts to a generic
> `driver::Registration` the `driver::RegistrationOps` trait is implemented
> by `platform::Adapter`.
>
> Signed-off-by: Danilo Krummrich <dakr@kernel.org>
> ---
> MAINTAINERS | 1 +
> rust/bindings/bindings_helper.h | 2 +
> rust/helpers/helpers.c | 1 +
> rust/helpers/platform.c | 13 +++
> rust/kernel/lib.rs | 1 +
> rust/kernel/platform.rs | 193 ++++++++++++++++++++++++++++++++
> 6 files changed, 211 insertions(+)
> create mode 100644 rust/helpers/platform.c
> create mode 100644 rust/kernel/platform.rs

Reviewed-by: Rob Herring (Arm) <robh@kernel.org>