We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e019684 commit d1f6d6cCopy full SHA for d1f6d6c
rust/kernel/pci.rs
@@ -382,12 +382,7 @@ impl Device {
382
/// Enable memory resources for this device.
383
pub fn enable_device_mem(&self) -> Result {
384
// SAFETY: `self.as_raw` is guaranteed to be a pointer to a valid `struct pci_dev`.
385
- let ret = unsafe { bindings::pci_enable_device_mem(self.as_raw()) };
386
- if ret != 0 {
387
- Err(Error::from_errno(ret))
388
- } else {
389
- Ok(())
390
- }
+ to_result(unsafe { bindings::pci_enable_device_mem(self.as_raw()) })
391
}
392
393
/// Enable bus-mastering for this device.
0 commit comments