rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ayush Singh <ayush@beagleboard.org>
To: "Jason Kridner" <jkridner@beagleboard.org>,
	"Deepak Khatri" <lorforlinux@beagleboard.org>,
	"Robert Nelson" <robertcnelson@beagleboard.org>,
	"Miguel Ojeda" <ojeda@kernel.org>, "Dhruva Gole" <d-gole@ti.com>,
	"Alex Gaynor" <alex.gaynor@gmail.com>,
	"Boqun Feng" <boqun.feng@gmail.com>,
	"Gary Guo" <gary@garyguo.net>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Andreas Hindborg" <a.hindborg@kernel.org>,
	"Alice Ryhl" <aliceryhl@google.com>,
	"Trevor Gross" <tmgross@umich.edu>,
	"Danilo Krummrich" <dakr@kernel.org>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	"Saravana Kannan" <saravanak@google.com>,
	"Benno Lossin" <lossin@kernel.org>,
	"Benno Lossin" <lossin@kernel.org>
Cc: rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org,
	 devicetree@vger.kernel.org, Ayush Singh <ayush@beagleboard.org>
Subject: [PATCH v2 0/2] rust: Add abstractions for applying devicetree overlays
Date: Sat, 16 Aug 2025 11:27:44 +0530	[thread overview]
Message-ID: <20250816-rust-overlay-abs-v2-0-48a2c8921df2@beagleboard.org> (raw)

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. 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.

2. 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.

Best Regards,
Ayush Singh

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

Changes in v2:
- Rebase on next-20250814
- Return error if buffer size too big instead of panic.
- Update the reference driver link.
- Use `to_of_node` on fwnode instead of getting of_node directly from
  struct device.
- Link to v1: https://lore.kernel.org/r/20250422-rust-overlay-abs-v1-0-85779c1b853d@beagleboard.org/

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/helpers/of.c               |  5 +++++
 rust/kernel/device/property.rs  | 18 ++++++++++++++++
 rust/kernel/of.rs               | 46 +++++++++++++++++++++++++++++++++++++++++
 4 files changed, 70 insertions(+)
---
base-commit: 931e46dcbc7e6035a90e9c4a27a84b660e083f0a
change-id: 20250417-rust-overlay-abs-36aac8b9752a

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


             reply	other threads:[~2025-08-16  5:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-16  5:57 Ayush Singh [this message]
2025-08-16  5:57 ` [PATCH v2 1/2] rust: kernel: of: Add DeviceNode abstraction Ayush Singh
2025-08-16  5:57 ` [PATCH v2 2/2] rust: kernel: of: Add overlay id abstraction Ayush Singh
2025-08-17  5:50   ` kernel test robot
2025-08-16 12:42 ` [PATCH v2 0/2] rust: Add abstractions for applying devicetree overlays Miguel Ojeda

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250816-rust-overlay-abs-v2-0-48a2c8921df2@beagleboard.org \
    --to=ayush@beagleboard.org \
    --cc=a.hindborg@kernel.org \
    --cc=alex.gaynor@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=d-gole@ti.com \
    --cc=dakr@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=gary@garyguo.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=jkridner@beagleboard.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lorforlinux@beagleboard.org \
    --cc=lossin@kernel.org \
    --cc=ojeda@kernel.org \
    --cc=rafael@kernel.org \
    --cc=robertcnelson@beagleboard.org \
    --cc=robh@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=saravanak@google.com \
    --cc=tmgross@umich.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).