@@ -39,7 +39,7 @@ impl Driver for PhyQT2025 {
const NAME: &'static CStr = c_str!("QT2025 10Gpbs SFP+");
const PHY_DEVICE_ID: phy::DeviceId = phy::DeviceId::new_with_exact_mask(0x0043a400);
- fn probe(dev: &mut phy::Device) -> Result<()> {
+ fn probe(dev: &mut phy::Device) -> Result {
// Check the hardware revision code.
// Only 0x3b works with this driver and firmware.
let hw_rev = dev.read(C45::new(Mmd::PMAPMD, 0xd001))?;
@@ -45,7 +45,7 @@ pub fn rotational(mut self, rotational: bool) -> Self {
/// Validate block size by verifying that it is between 512 and `PAGE_SIZE`,
/// and that it is a power of two.
- fn validate_block_size(size: u32) -> Result<()> {
+ fn validate_block_size(size: u32) -> Result {
if !(512..=bindings::PAGE_SIZE as u32).contains(&size) || !size.is_power_of_two() {
Err(error::code::EINVAL)
} else {
@@ -49,7 +49,7 @@
/// use kernel::error::Result;
/// use kernel::uaccess::{UserPtr, UserSlice};
///
-/// fn bytes_add_one(uptr: UserPtr, len: usize) -> Result<()> {
+/// fn bytes_add_one(uptr: UserPtr, len: usize) -> Result {
/// let (read, mut write) = UserSlice::new(uptr, len).reader_writer();
///
/// let mut buf = KVec::new();
@@ -144,11 +144,11 @@ pub fn module(ts: TokenStream) -> TokenStream {
/// // Declares a `#[vtable]` trait
/// #[vtable]
/// pub trait Operations: Send + Sync + Sized {
-/// fn foo(&self) -> Result<()> {
+/// fn foo(&self) -> Result {
/// kernel::build_error(VTABLE_DEFAULT_ERROR)
/// }
///
-/// fn bar(&self) -> Result<()> {
+/// fn bar(&self) -> Result {
/// kernel::build_error(VTABLE_DEFAULT_ERROR)
/// }
/// }
@@ -158,7 +158,7 @@ pub fn module(ts: TokenStream) -> TokenStream {
/// // Implements the `#[vtable]` trait
/// #[vtable]
/// impl Operations for Foo {
-/// fn foo(&self) -> Result<()> {
+/// fn foo(&self) -> Result {
/// # Err(EINVAL)
/// // ...
/// }