[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0ed88191-a40e-406f-bd75-4992fdbe2fdd@gmail.com>
Date: Sat, 13 Dec 2025 08:06:03 +0100
From: Dirk Behme <dirk.behme@...il.com>
To: Matthew Maurer <mmaurer@...gle.com>, Miguel Ojeda <ojeda@...nel.org>,
Boqun Feng <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>,
Benno Lossin <lossin@...nel.org>, Andreas Hindborg <a.hindborg@...nel.org>,
Alice Ryhl <aliceryhl@...gle.com>, Trevor Gross <tmgross@...ch.edu>,
Danilo Krummrich <dakr@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Rafael J. Wysocki" <rafael@...nel.org>
Cc: linux-kernel@...r.kernel.org, rust-for-linux@...r.kernel.org
Subject: Re: [PATCH 2/2] rust: Add SoC Driver Sample
On 13.12.25 00:14, Matthew Maurer wrote:
> Shows registration of a SoC device upon receipt of a probe.
>
> Signed-off-by: Matthew Maurer <mmaurer@...gle.com>
> ---
> MAINTAINERS | 1 +
> samples/rust/Kconfig | 11 +++++++
> samples/rust/Makefile | 1 +
> samples/rust/rust_soc.rs | 74 ++++++++++++++++++++++++++++++++++++++++++++++++
> 4 files changed, 87 insertions(+)
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 4ff01fb0f1bda27002094113c0bf9d074d28fdb6..bb2e710277cc84dd6042d4d46076e665d9f68752 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -7705,6 +7705,7 @@ F: samples/rust/rust_debugfs.rs
> F: samples/rust/rust_debugfs_scoped.rs
> F: samples/rust/rust_driver_platform.rs
> F: samples/rust/rust_driver_faux.rs
> +F: samples/rust/rust_soc.rs
>
> DRIVERS FOR OMAP ADAPTIVE VOLTAGE SCALING (AVS)
> M: Nishanth Menon <nm@...com>
> diff --git a/samples/rust/Kconfig b/samples/rust/Kconfig
> index 3efa51bfc8efccd91d9ee079ccd078ed1a6e8aa7..c49ab910634596aea4a1a73dac87585e084f420a 100644
> --- a/samples/rust/Kconfig
> +++ b/samples/rust/Kconfig
> @@ -161,6 +161,17 @@ config SAMPLE_RUST_DRIVER_AUXILIARY
>
> If unsure, say N.
>
> +config SAMPLE_RUST_SOC
> + tristate "SoC Driver"
> + select SOC_BUS
> + help
> + This option builds the Rust SoC driver sample.
> +
> + To compile this as a module, choose M here:
> + the module will be called rust_soc.
> +
> + If unsure, say N.
> +
> config SAMPLE_RUST_HOSTPROGS
> bool "Host programs"
> help
> diff --git a/samples/rust/Makefile b/samples/rust/Makefile
> index f65885d1d62bf406b0db13121ef3e5b09829cfbc..6c0aaa58ccccfd12ef019f68ca784f6d977bc668 100644
> --- a/samples/rust/Makefile
> +++ b/samples/rust/Makefile
> @@ -15,6 +15,7 @@ obj-$(CONFIG_SAMPLE_RUST_DRIVER_USB) += rust_driver_usb.o
> obj-$(CONFIG_SAMPLE_RUST_DRIVER_FAUX) += rust_driver_faux.o
> obj-$(CONFIG_SAMPLE_RUST_DRIVER_AUXILIARY) += rust_driver_auxiliary.o
> obj-$(CONFIG_SAMPLE_RUST_CONFIGFS) += rust_configfs.o
> +obj-$(CONFIG_SAMPLE_RUST_SOC) += rust_soc.o
>
> rust_print-y := rust_print_main.o rust_print_events.o
>
> diff --git a/samples/rust/rust_soc.rs b/samples/rust/rust_soc.rs
> new file mode 100644
> index 0000000000000000000000000000000000000000..ca0294819f100fa7b713c6b41c5b8a9b3906b863
> --- /dev/null
> +++ b/samples/rust/rust_soc.rs
> @@ -0,0 +1,74 @@
> +// SPDX-License-Identifier: GPL-2.0
> +
> +//! Rust SoC Platform driver sample.
> +
> +use kernel::{
> + acpi, c_str, device::Core, of, platform, prelude::*, soc, str::CString, sync::aref::ARef,
> +};
Should this be formatted according to
https://docs.kernel.org/rust/coding-guidelines.html#imports
as well?
Thanks
Dirk
Powered by blists - more mailing lists