rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] rust: regulator: improve the ergonomics of Rust regulators
@ 2025-09-08 23:10 Daniel Almeida
  2025-09-08 23:10 ` [PATCH v2 1/2] rust: regulator: remove Regulator<Dynamic> Daniel Almeida
                   ` (2 more replies)
  0 siblings, 3 replies; 23+ messages in thread
From: Daniel Almeida @ 2025-09-08 23:10 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, Miguel Ojeda, Alex Gaynor, Boqun Feng,
	Gary Guo, Björn Roy Baron, Benno Lossin, Andreas Hindborg,
	Alice Ryhl, Trevor Gross, Danilo Krummrich
  Cc: linux-kernel, rust-for-linux, Daniel Almeida, Alexandre Courbot

This small series comes after some extensive discussion on a few minor
changes that can improve the current Rust regulator API.

Patch 1 removes Regulator<Dynamic>, as we have now established that
there is no usecase that can't use the safer Regulator<Enabled> and
Regulator<Disabled> APIs instead.

Patch 2 makes "devm_regulator_enable_get" and
"devm_regulator_enable_get_optional" available in Rust. This comes after
realizing that a lot of drivers simply care about whether regulators are
enabled for as long as the device is bound.

Signed-off-by: Daniel Almeida <daniel.almeida@collabora.com>
---
Changes in v2:
- Picked up tags
- Rebased on regulator/for-next
- Renamed enable() and enable_optional() to devm_enable() and
  devm_enable_optional().
- Renamed patch 2/2 to pick up the above change
- Added more docs and links where applicable (thanks, Alex)

- Link to v1: https://lore.kernel.org/r/20250829-regulator-remove-dynamic-v1-0-deb59205e8e9@collabora.com

---
Daniel Almeida (2):
      rust: regulator: remove Regulator<Dynamic>
      rust: regulator: add devm_enable and devm_enable_optional

 rust/helpers/regulator.c |  10 ++++
 rust/kernel/regulator.rs | 146 +++++++++++++++++++----------------------------
 2 files changed, 68 insertions(+), 88 deletions(-)
---
base-commit: 59e8e7b7f2206d7097e43266722b625715720dfa
change-id: 20250829-regulator-remove-dynamic-f1a6b8c0c1b0

Best regards,
-- 
Daniel Almeida <daniel.almeida@collabora.com>


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

end of thread, other threads:[~2025-09-11 23:23 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-08 23:10 [PATCH v2 0/2] rust: regulator: improve the ergonomics of Rust regulators Daniel Almeida
2025-09-08 23:10 ` [PATCH v2 1/2] rust: regulator: remove Regulator<Dynamic> Daniel Almeida
2025-09-08 23:10 ` [PATCH v2 2/2] rust: regulator: add devm_enable and devm_enable_optional Daniel Almeida
2025-09-09  2:29   ` Alexandre Courbot
2025-09-09  6:57   ` Boqun Feng
2025-09-09 15:04     ` Daniel Almeida
2025-09-09 15:38       ` Boqun Feng
2025-09-09 15:58         ` Miguel Ojeda
2025-09-09 16:27           ` Boqun Feng
2025-09-09 17:11             ` Mark Brown
2025-09-09 17:15               ` Boqun Feng
2025-09-09 21:10                 ` Mark Brown
2025-09-09 17:16               ` Miguel Ojeda
2025-09-09 16:12         ` Daniel Almeida
2025-09-09 16:40           ` Boqun Feng
2025-09-09 17:02             ` Daniel Almeida
2025-09-09 17:03             ` Daniel Almeida
2025-09-09 16:17         ` Mark Brown
2025-09-09 16:29           ` Danilo Krummrich
2025-09-09 17:10             ` Mark Brown
2025-09-09  7:15   ` Danilo Krummrich
2025-09-10  5:26   ` Boqun Feng
2025-09-11 23:23 ` (subset) [PATCH v2 0/2] rust: regulator: improve the ergonomics of Rust regulators Mark Brown

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