Skip to content

RFC Initial rust bindings for device property reads

Rob Herring (Arm) linux-devicetree lkml rust-for-linux 1 version In review

Get series with b4
b4 am [email protected] change-id 20241025-rust-platform-dev-0e89debcbba5

Versions newest first

  1. v1 RFC Latest3 patches 24 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3of: unittest: Add a platform device node for rust platform driver sampledrivers/of/unittest-data/tests-platform.dtsi samples/rust/rust_driver_platform.rs+6 -11 reply
2/3rust: Add bindings for device propertiesrust/bindings/bindings_helper.h rust/kernel/device.rs+145 -121 replies
3/3samples: rust: platform: Add property read examplesdrivers/of/unittest-data/tests-platform.dtsi samples/rust/rust_driver_platform.rs+25 -01 reply

Reviews trailers per patch

1 of 3 patches has a Reviewed-by or Acked-by.

PatchDirk Behme
SeriesT-b
1/3R-b
2/3
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH RFC 0/3] Initial rust bindings for device property reads

I got asked about upstreaming DT rust bindings, so I decided to take a stab at it. This series adds rust bindings for the device property API which is a firmware agnostic interface for reading firmware properties. There are "DT rust bindings" patches floating around, but for many drivers they don't need to know any DT specifics nor deal with struct device_node (and its refcounts). And reading firmware properties are simple enough for my feeble rust abilities.

This series is based on top of Danilo's PCI and platform device series[1], though that's really only for the sample driver.

Please tell me how my rust code sucks before I spend more time beating my head against the wall^W^W^W^W^W^W learning rust.

Rob

[1] https://lore.kernel.org/all/[email protected]/

---
Rob Herring (Arm) (3):
of: unittest: Add a platform device node for rust platform driver sample
rust: Add bindings for device properties
samples: rust: platform: Add property read examples

 drivers/of/unittest-data/tests-platform.dtsi |   8 ++
 rust/bindings/bindings_helper.h              |   1 +
 rust/kernel/device.rs                        | 145 ++++++++++++++++++++++++++-
 samples/rust/rust_driver_platform.rs         |  24 ++++-
 4 files changed, 176 insertions(+), 2 deletions(-)

---
base-commit: eeb31b3e7e9e1b485763ecc66ece8afba1416b2a
change-id: 20241025-rust-platform-dev-0e89debcbba5

Best regards,

Signature · 1 line
Rob Herring (Arm) <[email protected]>