Re: [PATCH v2 3/5] rust: drm: gem: shmem: Implement prime_import_sg_table callback

From: Alice Ryhl

Date: Tue Nov 24 2026 - 11:53:11 EST


On Tue, Nov 24, 2026 at 12:37:45PM +0100, Janne Grunau wrote:
> + // SAFETY: The DRM shmem helper only invokes this callback for a registered DRM device of
> + // type `T::Driver`, which is `Self`'s driver per the `AllocImpl` impl below.
> + let dev: &Device<T::Driver> = unsafe { Device::from_raw(raw_dev) };

`drm::Driver` in `rust/kernel/drm/driver.rs` currently declares:

type Object: AllocImpl;

without any constraint that `T::Object::Driver = T`. I think we should
introduce one similar to how Driver::File constrains this?

Alice