Message ID | 20241118-simplify-result-qt2025-v2-1-af1bcff5d101@iiitd.ac.in (mailing list archive) |
---|---|
State | New |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net-next,v2] net: phy: qt2025: simplify Result<()> in probe return | expand |
On Mon, Nov 18, 2024 at 3:30 PM Manas via B4 Relay <devnull+manas18244.iiitd.ac.in@kernel.org> wrote: > > From: Manas <manas18244@iiitd.ac.in> > > probe returns a `Result<()>` type, which can be simplified as `Result`, > due to default type parameters being unit `()` and `Error` types. This > maintains a consistent usage of `Result` throughout codebase. > > Suggested-by: Miguel Ojeda <ojeda@kernel.org> > Link: https://github.com/Rust-for-Linux/linux/issues/1128 > Signed-off-by: Manas <manas18244@iiitd.ac.in> Reviewed-by: Miguel Ojeda <ojeda@kernel.org> Cheers, Miguel
diff --git a/drivers/net/phy/qt2025.rs b/drivers/net/phy/qt2025.rs index 1ab065798175b4f54c5f2fd6c871ba2942c48bf1..25c12a02baa255d3d5952e729a890b3ccfe78606 100644 --- a/drivers/net/phy/qt2025.rs +++ b/drivers/net/phy/qt2025.rs @@ -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))?;