On Sat, 2026-05-30 at 17:36 +0000, Markus Probst wrote: > > +#[doc(hidden)] > +#[pin_data(PinnedDrop)] > +pub struct PrivateData<'bound, T: Driver> { > + sdev: &'bound Device, > + #[pin] > + driver: UnsafeCell>>, > + #[pin] > + probe_complete: Completion, > + error: UnsafeCell, > +} > + > +#[pinned_drop] > +impl PinnedDrop for PrivateData<'_, T> { > + fn drop(self: Pin<&mut Self>) { > + // SAFETY: No one has exclusive access to `self.error`. > + if !unsafe { *self.error.get() } { > + // SAFETY: > + // - We have exclusive access to `self.driver`. > + // - `self.driver` is guaranteed to be initialized. > + unsafe { (*self.driver.get()).assume_init_drop() }; > + } > + > + // SAFETY: `self.sdev.as_raw()` is guaranteed to be a pointer to a valid > + // `struct serdev_device`. > + unsafe { bindings::serdev_device_close(self.sdev.as_raw()) }; Ok, I might have sent this too early. ignore for now. This is unsound. Thanks - Markus Probst > + } > +} > +