Skip to content

Commit 599b75a

Browse files
fujitadavem330
authored andcommitted
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 <[email protected]> Reviewed-by: Trevor Gross <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 1d4046b commit 599b75a

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

rust/kernel/net/phy.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -580,12 +580,12 @@ pub trait Driver {
580580

581581
/// Issues a PHY software reset.
582582
fn soft_reset(_dev: &mut Device) -> Result {
583-
Err(code::ENOTSUPP)
583+
kernel::build_error(VTABLE_DEFAULT_ERROR)
584584
}
585585

586586
/// Probes the hardware to determine what abilities it has.
587587
fn get_features(_dev: &mut Device) -> Result {
588-
Err(code::ENOTSUPP)
588+
kernel::build_error(VTABLE_DEFAULT_ERROR)
589589
}
590590

591591
/// Returns true if this is a suitable driver for the given phydev.
@@ -597,32 +597,32 @@ pub trait Driver {
597597
/// Configures the advertisement and resets auto-negotiation
598598
/// if auto-negotiation is enabled.
599599
fn config_aneg(_dev: &mut Device) -> Result {
600-
Err(code::ENOTSUPP)
600+
kernel::build_error(VTABLE_DEFAULT_ERROR)
601601
}
602602

603603
/// Determines the negotiated speed and duplex.
604604
fn read_status(_dev: &mut Device) -> Result<u16> {
605-
Err(code::ENOTSUPP)
605+
kernel::build_error(VTABLE_DEFAULT_ERROR)
606606
}
607607

608608
/// Suspends the hardware, saving state if needed.
609609
fn suspend(_dev: &mut Device) -> Result {
610-
Err(code::ENOTSUPP)
610+
kernel::build_error(VTABLE_DEFAULT_ERROR)
611611
}
612612

613613
/// Resumes the hardware, restoring state if needed.
614614
fn resume(_dev: &mut Device) -> Result {
615-
Err(code::ENOTSUPP)
615+
kernel::build_error(VTABLE_DEFAULT_ERROR)
616616
}
617617

618618
/// Overrides the default MMD read function for reading a MMD register.
619619
fn read_mmd(_dev: &mut Device, _devnum: u8, _regnum: u16) -> Result<u16> {
620-
Err(code::ENOTSUPP)
620+
kernel::build_error(VTABLE_DEFAULT_ERROR)
621621
}
622622

623623
/// Overrides the default MMD write function for writing a MMD register.
624624
fn write_mmd(_dev: &mut Device, _devnum: u8, _regnum: u16, _val: u16) -> Result {
625-
Err(code::ENOTSUPP)
625+
kernel::build_error(VTABLE_DEFAULT_ERROR)
626626
}
627627

628628
/// Callback for notification of link change.

0 commit comments

Comments
 (0)