Re: [PATCH] rust: miscdevice: add registration data to MiscDevice
Alice Ryhl <[email protected]>
| Newsgroups | org.kernel.vger.rust-for-linux,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <CAH5fLggVkEYB0_SXcSGVBgs2hDejSU8P_y-5BvbyNhEvBPY1eQ@mail.gmail.com> |
On Fri, Aug 7, 2026 at 4:43 PM Gary Guo <[email protected]> wrote: > > On Fri Aug 7, 2026 at 3:22 PM BST, Alice Ryhl wrote: > > impl<T: MiscDevice> MiscDeviceRegistration<T> { > > /// Register a misc device. > > - pub fn register(opts: MiscDeviceOptions) -> impl PinInit<Self, Error> { > > + pub fn register( > > + opts: MiscDeviceOptions, > > + data: impl PinInit<T::RegistrationData, Error>, > > We can just skip the `RegistrationData` and use `T`? `T` is the type of the data stored per-fd. We do not separate types for those two concepts. Alice