Re: [PATCH] rust/kernel: Add faux device bindings

Danilo Krummrich
2025-02-06T22:39:37Z

On Thu, Feb 06, 2025 at 11:30:30PM +0100, Danilo Krummrich wrote:
> On Thu, Feb 06, 2025 at 04:04:56PM -0500, Lyude Paul wrote:
> > This introduces a crate for working with faux devices in rust, along with
> > adding sample code to show how the API is used. Unlike other types of
> > devices, we don't provide any hooks for device probe/removal - since these
> > are optional for the faux API and are unnecessary in rust.
> >
> > Signed-off-by: Lyude Paul <lyude@redhat.com>
> > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > Cc: Maíra Canal <mairacanal@riseup.net>
> > ---
> > rust/bindings/bindings_helper.h | 1 +
> > rust/kernel/faux.rs | 60 ++++++++++++++++++++++++++++++++
> > rust/kernel/lib.rs | 1 +
> > samples/rust/Kconfig | 10 ++++++
> > samples/rust/Makefile | 1 +
> > samples/rust/rust_driver_faux.rs | 29 +++++++++++++++
> > 6 files changed, 102 insertions(+)
> > create mode 100644 rust/kernel/faux.rs
> > create mode 100644 samples/rust/rust_driver_faux.rs

Forgot to mention, we should also add the new files to the MAINTAINERS file.