Commit 2ef6dbc7 authored by Alice Ryhl's avatar Alice Ryhl
Browse files

BACKPORT: rust: miscdevice: change how f_ops vtable is constructed



I was helping someone with writing a new Rust abstraction, and we were
using the miscdevice abstraction as an example. While doing this, it
became clear to me that the way I implemented the f_ops vtable is
confusing to new Rust users, and that the approach used by the block
abstractions is less confusing.

Thus, update the miscdevice abstractions to use the same approach as
rust/kernel/block/mq/operations.rs.

Sorry about the large diff. This changes the indentation of a large
amount of code.

Reviewed-by: default avatarChristian Schrefl <chrisi.schrefl@gmail.com>
Signed-off-by: default avatarAlice Ryhl <aliceryhl@google.com>
Link: https://lore.kernel.org/r/20250227-miscdevice-fops-change-v1-1-c9e9b75d67eb@google.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 429146594
[ aliceryhl: also adjust llseek and similar to new style ]
(cherry picked from commit 74fc3493)
Change-Id: Ie87c5015d483a4c5a27ab17ae8a836a8956d1092
Signed-off-by: default avatarAlice Ryhl <aliceryhl@google.com>
parent 1acd3b31
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment