Commit 599b75a3 authored by FUJITA Tomonori's avatar FUJITA Tomonori Committed by David S. Miller

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: default avatarFUJITA Tomonori <fujita.tomonori@gmail.com>
Reviewed-by: default avatarTrevor Gross <tmgross@umich.edu>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1d4046b5
...@@ -580,12 +580,12 @@ pub trait Driver { ...@@ -580,12 +580,12 @@ pub trait Driver {
/// Issues a PHY software reset. /// Issues a PHY software reset.
fn soft_reset(_dev: &mut Device) -> Result { 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. /// Probes the hardware to determine what abilities it has.
fn get_features(_dev: &mut Device) -> Result { 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. /// Returns true if this is a suitable driver for the given phydev.
...@@ -597,32 +597,32 @@ fn match_phy_device(_dev: &Device) -> bool { ...@@ -597,32 +597,32 @@ fn match_phy_device(_dev: &Device) -> bool {
/// Configures the advertisement and resets auto-negotiation /// Configures the advertisement and resets auto-negotiation
/// if auto-negotiation is enabled. /// if auto-negotiation is enabled.
fn config_aneg(_dev: &mut Device) -> Result { fn config_aneg(_dev: &mut Device) -> Result {
Err(code::ENOTSUPP) kernel::build_error(VTABLE_DEFAULT_ERROR)
} }
/// Determines the negotiated speed and duplex. /// Determines the negotiated speed and duplex.
fn read_status(_dev: &mut Device) -> Result<u16> { fn read_status(_dev: &mut Device) -> Result<u16> {
Err(code::ENOTSUPP) kernel::build_error(VTABLE_DEFAULT_ERROR)
} }
/// Suspends the hardware, saving state if needed. /// Suspends the hardware, saving state if needed.
fn suspend(_dev: &mut Device) -> Result { fn suspend(_dev: &mut Device) -> Result {
Err(code::ENOTSUPP) kernel::build_error(VTABLE_DEFAULT_ERROR)
} }
/// Resumes the hardware, restoring state if needed. /// Resumes the hardware, restoring state if needed.
fn resume(_dev: &mut Device) -> Result { 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. /// Overrides the default MMD read function for reading a MMD register.
fn read_mmd(_dev: &mut Device, _devnum: u8, _regnum: u16) -> Result<u16> { 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. /// Overrides the default MMD write function for writing a MMD register.
fn write_mmd(_dev: &mut Device, _devnum: u8, _regnum: u16, _val: u16) -> Result { 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. /// Callback for notification of link change.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment