Skip to content

Commit d85ac21

Browse files
hoshinolinajannau
authored andcommitted
fixup! rust: dma_fence: Add DMA Fence abstraction
1 parent 10e6928 commit d85ac21

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

rust/kernel/dma_fence.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ pub trait RawDmaFence: crate::private::Sealed {
3838

3939
/// Advances this fence to the chain node which will signal this sequence number.
4040
/// If no sequence number is provided, this returns `self` again.
41-
fn chain_find_seqno(self, seqno: u64) -> Result<Fence>
41+
/// If the seqno has already been signaled, returns None.
42+
fn chain_find_seqno(self, seqno: u64) -> Result<Option<Fence>>
4243
where
4344
Self: Sized,
4445
{
@@ -53,10 +54,10 @@ pub trait RawDmaFence: crate::private::Sealed {
5354
unsafe { bindings::dma_fence_put(ptr) };
5455
Err(Error::from_errno(ret))
5556
} else if ptr.is_null() {
56-
Err(EINVAL) // When can this happen?
57+
Ok(None)
5758
} else {
5859
// SAFETY: ptr is valid and non-NULL as checked above.
59-
Ok(unsafe { Fence::from_raw(ptr) })
60+
Ok(Some(unsafe { Fence::from_raw(ptr) }))
6061
}
6162
}
6263

0 commit comments

Comments
 (0)