rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] rust: Add abstractions for applying devicetree overlays
@ 2025-04-22 12:32 Ayush Singh
  2025-04-22 12:32 ` [PATCH 1/2] rust: kernel: of: Add DeviceNode abstraction Ayush Singh
  2025-04-22 12:32 ` [PATCH 2/2] rust: kernel: of: Add overlay id abstraction Ayush Singh
  0 siblings, 2 replies; 3+ messages in thread
From: Ayush Singh @ 2025-04-22 12:32 UTC (permalink / raw)
  To: Jason Kridner, Deepak Khatri, Robert Nelson, Miguel Ojeda,
	Dhruva Gole, Alex Gaynor, Boqun Feng, Gary Guo,
	Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
	Trevor Gross, Danilo Krummrich, Greg Kroah-Hartman,
	Rafael J. Wysocki, Rob Herring, Saravana Kannan
  Cc: rust-for-linux, linux-kernel, devicetree, Ayush Singh

The following patch series adds abstractions required to apply
devicetree overlays from Rust code. To see how the bindings look in
usage, see my working tree [0] for a connector driver  I am working on.

Open Questions
***************

1. Should `DeviceNode` be Opaque?

Since this structure is never read/constructed from Rust side, maybe it's
better off as Opaque.

2. Removing overlay on drop

I my usecase (see [0]), I will only ever have 1 active overlay in the
driver, which I will be removing dynamically. So removing overlay on
drop works for it. But maybe there are some usecases I am missing.

3. Only enable bindings when CONFIG_OF_OVERLAY is set?

The kernel header currently seems to provide blank implementations of
these methods when `CONFIG_OF_OVERLAY` is not enabled. But I am not sure
what is rust-for-linux policy here.

[0]: https://github.com/Ayush1325/linux/commits/b4/beagle-cape/

Signed-off-by: Ayush Singh <ayush@beagleboard.org>
---
Ayush Singh (2):
      rust: kernel: of: Add DeviceNode abstraction
      rust: kernel: of: Add overlay id abstraction

 rust/bindings/bindings_helper.h |  1 +
 rust/kernel/device.rs           |  5 ++++
 rust/kernel/of.rs               | 53 ++++++++++++++++++++++++++++++++++++++++-
 3 files changed, 58 insertions(+), 1 deletion(-)
---
base-commit: bc8aa6cdadcc00862f2b5720e5de2e17f696a081
change-id: 20250417-rust-overlay-abs-36aac8b9752a

Best regards,
-- 
Ayush Singh <ayush@beagleboard.org>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-04-22 12:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-22 12:32 [PATCH 0/2] rust: Add abstractions for applying devicetree overlays Ayush Singh
2025-04-22 12:32 ` [PATCH 1/2] rust: kernel: of: Add DeviceNode abstraction Ayush Singh
2025-04-22 12:32 ` [PATCH 2/2] rust: kernel: of: Add overlay id abstraction Ayush Singh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).