]> www.infradead.org Git - users/jedix/linux-maple.git/commit
rust: miscdevice: clarify invariant for `MiscDeviceRegistration`
authorShankari Anand <shankari.ak0208@gmail.com>
Thu, 26 Jun 2025 10:45:20 +0000 (16:15 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 1 Jul 2025 09:21:10 +0000 (11:21 +0200)
commitb9ff1c2a26fa31216be18e9b14c419ff8fe39e72
treeffb1474bb0d20f6fb5fda00e518f5c2154114338
parent9b5cdd5f40191d11d3b535ab7978751a4a3e4bc5
rust: miscdevice: clarify invariant for `MiscDeviceRegistration`

Reword and expand the invariant documentation for `MiscDeviceRegistration`
to clarify what it means for the inner device to be "registered".
It expands to explain:
- `inner` points to a `miscdevice` registered via `misc_register`.
- This registration stays valid for the entire lifetime of the object.
- Deregistration is guaranteed on `Drop`, via `misc_deregister`.

Reported-by: Benno Lossin <lossin@kernel.org>
Closes: https://github.com/Rust-for-Linux/linux/issues/1168
Fixes: f893691e7426 ("rust: miscdevice: add base miscdevice abstraction")
Signed-off-by: Shankari Anand <shankari.ak0208@gmail.com>
Link: https://lore.kernel.org/r/20250626104520.563036-1-shankari.ak0208@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
rust/kernel/miscdevice.rs