File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -177,7 +177,7 @@ impl<T> BaseObject for T where Self: crate::types::AlwaysRefCounted + IntoGEMObj
177
177
#[ pin_data]
178
178
pub struct Object < T : DriverObject + Send + Sync > {
179
179
obj : Opaque < bindings:: drm_gem_object > ,
180
- dev : * const drm:: Device < T :: Driver > ,
180
+ dev : NonNull < drm:: Device < T :: Driver > > ,
181
181
#[ pin]
182
182
data : T ,
183
183
}
@@ -212,7 +212,7 @@ impl<T: DriverObject> Object<T> {
212
212
data <- T :: new( dev, size) ,
213
213
// INVARIANT: The drm subsystem guarantees that the `struct drm_device` will live
214
214
// as long as the GEM object lives.
215
- dev,
215
+ dev: dev . into ( ) ,
216
216
} ) ,
217
217
GFP_KERNEL ,
218
218
) ?;
@@ -237,7 +237,7 @@ impl<T: DriverObject> Object<T> {
237
237
pub fn dev ( & self ) -> & drm:: Device < T :: Driver > {
238
238
// SAFETY: The DRM subsystem guarantees that the `struct drm_device` will live as long as
239
239
// the GEM object lives, hence the pointer must be valid.
240
- unsafe { & * self . dev }
240
+ unsafe { self . dev . as_ref ( ) }
241
241
}
242
242
243
243
fn as_raw ( & self ) -> * mut bindings:: drm_gem_object {
You can’t perform that action at this time.
0 commit comments