diff options
author | FUJITA Tomonori <fujita.tomonori@gmail.com> | 2024-01-25 10:45:02 +0900 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2024-01-27 14:28:00 +0000 |
commit | 599b75a3b753ad06444a4e9667cb0b7545c297c3 (patch) | |
tree | b723a25b75a565cc9b7f2e8232d1e658df9a4a9d /rust | |
parent | 1d4046b5714200ad3a20be09843a63c1c1c9dafe (diff) |
rust: phy: use VTABLE_DEFAULT_ERROR
Since 6.8-rc1, using VTABLE_DEFAULT_ERROR for optional functions
(never called) in #[vtable] is the recommended way.
Note that no functional changes in this patch.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>
Reviewed-by: Trevor Gross <tmgross@umich.edu>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'rust')
-rw-r--r-- | rust/kernel/net/phy.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/rust/kernel/net/phy.rs b/rust/kernel/net/phy.rs index 203918192a1f..96e09c6e8530 100644 --- a/rust/kernel/net/phy.rs +++ b/rust/kernel/net/phy.rs @@ -580,12 +580,12 @@ pub trait Driver { /// Issues a PHY software reset. fn soft_reset(_dev: &mut Device) -> Result { - Err(code::ENOTSUPP) + kernel::build_error(VTABLE_DEFAULT_ERROR) } /// Probes the hardware to determine what abilities it has. fn get_features(_dev: &mut Device) -> Result { - Err(code::ENOTSUPP) + kernel::build_error(VTABLE_DEFAULT_ERROR) } /// Returns true if this is a suitable driver for the given phydev. @@ -597,32 +597,32 @@ pub trait Driver { /// Configures the advertisement and resets auto-negotiation /// if auto-negotiation is enabled. fn config_aneg(_dev: &mut Device) -> Result { - Err(code::ENOTSUPP) + kernel::build_error(VTABLE_DEFAULT_ERROR) } /// Determines the negotiated speed and duplex. fn read_status(_dev: &mut Device) -> Result<u16> { - Err(code::ENOTSUPP) + kernel::build_error(VTABLE_DEFAULT_ERROR) } /// Suspends the hardware, saving state if needed. fn suspend(_dev: &mut Device) -> Result { - Err(code::ENOTSUPP) + kernel::build_error(VTABLE_DEFAULT_ERROR) } /// Resumes the hardware, restoring state if needed. fn resume(_dev: &mut Device) -> Result { - Err(code::ENOTSUPP) + kernel::build_error(VTABLE_DEFAULT_ERROR) } /// Overrides the default MMD read function for reading a MMD register. fn read_mmd(_dev: &mut Device, _devnum: u8, _regnum: u16) -> Result<u16> { - Err(code::ENOTSUPP) + kernel::build_error(VTABLE_DEFAULT_ERROR) } /// Overrides the default MMD write function for writing a MMD register. fn write_mmd(_dev: &mut Device, _devnum: u8, _regnum: u16, _val: u16) -> Result { - Err(code::ENOTSUPP) + kernel::build_error(VTABLE_DEFAULT_ERROR) } /// Callback for notification of link change. |