Skip to content

Commit e659371

Browse files
committed
drm/asahi: workqueue: Access AsahiData via pdev.drvdata
Signed-off-by: Janne Grunau <j@jannau.net>
1 parent 9e750de commit e659371

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

drivers/gpu/drm/asahi/workqueue.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
//! up its associated event.
1515
1616
use crate::debug::*;
17+
use crate::driver::AsahiDriver;
1718
use crate::fw::channels::{ChannelErrorType, PipeType};
1819
use crate::fw::types::*;
1920
use crate::fw::workqueue::*;
@@ -32,6 +33,7 @@ use kernel::{
3233
lock::{mutex::MutexBackend, Guard},
3334
Arc, Mutex,
3435
},
36+
types::ForeignOwnable,
3537
uapi,
3638
workqueue::{self, impl_has_work, new_work, Work, WorkItem},
3739
};
@@ -147,9 +149,10 @@ impl GpuContext {
147149
impl Drop for GpuContext {
148150
fn drop(&mut self) {
149151
mod_dev_dbg!(self.dev, "GpuContext: Freeing GPU context\n");
150-
let dev = self.dev.data();
152+
let dev_data =
153+
unsafe { &<KBox<AsahiDriver>>::borrow(self.dev.as_ref().get_drvdata()).data };
151154
let data = self.data.take().unwrap();
152-
dev.gpu.free_context(data);
155+
dev_data.gpu.free_context(data);
153156
}
154157
}
155158

0 commit comments

Comments
 (0)