Skip to content

Commit 8352c3d

Browse files
committed
rust: platform: Add platform::Device::get_device()
Signed-off-by: Janne Grunau <j@jannau.net>
1 parent 0582009 commit 8352c3d

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

rust/kernel/platform.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,10 @@ impl Device {
216216
unsafe { container_of!(self.dev.as_raw(), bindings::platform_device, dev) }.cast_mut()
217217
}
218218

219+
pub fn get_device(&self) -> ARef<device::Device> {
220+
self.dev.clone()
221+
}
222+
219223
/// Sets the DMA masks (normal and coherent) for a platform device.
220224
pub fn set_dma_masks(&mut self, mask: u64) -> Result {
221225
// SAFETY: `self.ptr` is valid by the type invariant.

0 commit comments

Comments
 (0)