rust: miscdevice: Provide accessor to pull out miscdevice::this_device
authorLee Jones <lee@kernel.org>
Tue, 10 Dec 2024 09:39:02 +0000 (09:39 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 16 Dec 2024 15:12:34 +0000 (16:12 +0100)
commit284ae0be4dcafff0a154c1e69e7430c144a7ddc2
tree9c51223039af8413237737347f3d62ef4837d52b
parent88441d5c6d17211bcbd5b429205b09c25598f756
rust: miscdevice: Provide accessor to pull out miscdevice::this_device

There are situations where a pointer to a `struct device` will become
necessary (e.g. for calling into dev_*() functions).  This accessor
allows callers to pull this out from the `struct miscdevice`.

Signed-off-by: Lee Jones <lee@kernel.org>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Tested-by: Lee Jones <lee@kernel.org>
Reviewed-by: Danilo Krummrich <dakr@kernel.org>
Link: https://lore.kernel.org/r/20241210-miscdevice-file-param-v3-3-b2a79b666dc5@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
rust/kernel/miscdevice.rs