[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250414152630.1691179-1-remo@buenzli.dev>
Date: Mon, 14 Apr 2025 17:26:25 +0200
From: Remo Senekowitsch <remo@...nzli.dev>
To: Rob Herring <robh@...nel.org>,
Saravana Kannan <saravanak@...gle.com>,
Miguel Ojeda <ojeda@...nel.org>,
Alex Gaynor <alex.gaynor@...il.com>,
Boqun Feng <boqun.feng@...il.com>,
Gary Guo <gary@...yguo.net>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>,
Benno Lossin <benno.lossin@...ton.me>,
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>,
Remo Senekowitsch <remo@...nzli.dev>
Cc: linux-kernel@...r.kernel.org,
devicetree@...r.kernel.org,
rust-for-linux@...r.kernel.org
Subject: [PATCH v2 0/5] More Rust bindings for device property reads
This adds more Rust bindings for reading device properties, based on
Rob Herring's work. I'm working on a driver[1] that uses these, but the
driver has more dependencies than this.
Rob Herring and Dirk Behme did several review iterations over on Zulip
already[1], I'm thankful for their great input.
This is my second-ever patch series. I read through the documentation
for sending patches[2] carefully, trying to apply everything to the best
of my understanding. Please point out any specifics if I got something
wrong.
Best regards,
Remo
changes in v2:
- Add property.rs to maintainers file
- Add and improve lots of safety comments
- Use `__dev_fwnode` istead of `dev_fwnode` to express the intent better
- Make `get_child_by_name` not return a `PropertyGuard`
- Squash the patch with the generic read method
- Squash the PropertyGuard patch
- Remove `arrayvec`, abstract over `fwnode_reference_args` instead
- Log the full fwnode path in case of a missing property
- Remove integer trait and export of fwnode_property_read_int_array
These are not needed now that a macro is used to associate each
integer type with its corresponding `read_*_array` function.
- Replace `impl Property for bool` with a standalone function
`property_read_bool` with an infallible function signature
- Extract parsing of properties into separate function in sample
platform driver
Link: https://rust-for-linux.zulipchat.com/#narrow/channel/288089-General/topic/DS90UB954.20driver.20done.2C.20ready.20to.20upstream.3F/with/507874342 [1]
Link: https://www.kernel.org/doc/html/latest/process/submitting-patches.html#the-canonical-patch-format [2]
Remo Senekowitsch (5):
rust: Move property_present to separate file
rust: Add bindings for reading device properties
rust: property: Add child accessor and iterator
rust: property: Add property_get_reference_args
samples: rust: platform: Add property read examples
MAINTAINERS | 1 +
drivers/of/unittest-data/tests-platform.dtsi | 3 +
rust/helpers/helpers.c | 1 +
rust/helpers/property.c | 8 +
rust/kernel/device.rs | 7 -
rust/kernel/lib.rs | 1 +
rust/kernel/property.rs | 608 +++++++++++++++++++
samples/rust/rust_driver_platform.rs | 69 ++-
8 files changed, 688 insertions(+), 10 deletions(-)
create mode 100644 rust/helpers/property.c
create mode 100644 rust/kernel/property.rs
--
2.49.0
Powered by blists - more mailing lists