Re: [PATCH v2 2/2] samples: rust: fwctl: add sample code for fwctl

Jason Gunthorpe
2026-01-22T20:58:12Z

On Thu, Jan 22, 2026 at 10:42:31PM +0200, Zhi Wang wrote:
> This patch adds a sample Rust driver demonstrating the usage of the fwctl
> Rust abstractions. Add sample code for creating a FwCtl device, getting
> device info and issuing an RPC.
>
> Cc: Danilo Krummrich <dakr@kernel.org>
> Cc: Jason Gunthorpe <jgg@nvidia.com>
> Signed-off-by: Zhi Wang <zhiw@nvidia.com>
> ---
> samples/rust/Kconfig | 11 +++
> samples/rust/Makefile | 1 +
> samples/rust/rust_driver_fwctl.rs | 136 ++++++++++++++++++++++++++++++
> 3 files changed, 148 insertions(+)
> create mode 100644 samples/rust/rust_driver_fwctl.rs

Is this normal for Rust? Can we delete it when a real driver is
merged?

I'm not so keen on sample drivers, I've spent far too much time lately
touching sample drivers that nobody ever uses :(

Jason