Re: [PATCH 1/2] rust: hwmon: add hwmon abstractions
From: Markus Probst
Date: Fri Dec 04 2026 - 11:43:05 EST
On Fri, 2026-10-16 at 15:24 +0800, skxby wrote:
> > > From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
> From: skxby <2374604267@xxxxxx>
> Date: Fri, 16 Oct 2026 15:12:27 +0800
> Subject: [PATCH 1/2] rust: hwmon: add hwmon abstractions
>
> Add Rust abstractions for the hwmon subsystem.
>
> The main type is Registration<T>, which owns and pins its inner state,
> registers the hwmon device, and unregisters it on drop. A Driver trait
> provides callbacks for the temperature and chip attribute families; the
> chip callbacks are optional, following the existing #[vtable] idiom used
> by other subsystems. Channel configuration masks are derived from the
> modeled attribute enums.
>
> This is a rework of the abstraction proposed in the RFC "rust: hwmon:
> add basic hwmon abstractions" [1], brought up to the current rust tree:
> registration does not use devm, the sensor type enumeration covers the
> chip family in addition to the temperature family, and the resource is
> released explicitly on the registration error path.
>
> [1] https://lore.kernel.org/all/20260512155747.10136-1-donplat@xxxxxxxxxxxxx/
>
> Signed-off-by: skxby <2374604267@xxxxxx>
> ---
> rust/bindings/bindings_helper.h | 1 +
> rust/kernel/hwmon.rs | 491 ++++++++++++++++++++++++++++++++
> rust/kernel/lib.rs | 2 +
> 3 files changed, 494 insertions(+)
> create mode 100644 rust/kernel/hwmon.rs
>
please add me to CC.
Also, you mentioned "v2 is being finalized" almost 2 months ago [1]. I
haven't found it on the LKML. If it has been sent, please link me to
it.
You should also add an entry to the MAINTAINERS file in this patch.
Thanks
- Markus Probst
[1]
https://lore.kernel.org/all/tencent_3A4DA800AA0FC8C76CB748048FFA0DCC210A@xxxxxx/
Attachment:
signature.asc
Description: This is a digitally signed message part