WSL2-Linux-Kernel/drivers/net/pcs
Serge Semin 0f22f30f79 net: pcs: xpcs: Return EINVAL in the internal methods
[ Upstream commit f5151005d379d9ce42e327fd3b2d2aaef61cda81 ]

In particular the xpcs_soft_reset() and xpcs_do_config() functions
currently return -1 if invalid auto-negotiation mode is specified. That
value might be then passed to the generic kernel subsystems which require
a standard kernel errno value. Even though the erroneous conditions are
very specific (memory corruption or buggy driver implementation) using a
hard-coded -1 literal doesn't seem correct anyway especially when it comes
to passing it higher to the network subsystem or printing to the system
log.  Convert the hard-coded error values to -EINVAL then.

Signed-off-by: Serge Semin <fancer.lancer@gmail.com>
Tested-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-04-13 13:01:43 +02:00
..
Kconfig net: pcs-xpcs: depend on MDIO_BUS instead of selecting it 2020-10-16 16:54:11 -07:00
Makefile net: pcs: xpcs: add support for NXP SJA1105 2021-06-11 13:43:56 -07:00
pcs-lynx.c net: pcs: add pcs-lynx 1000BASE-X support 2021-02-06 14:35:21 -08:00
pcs-xpcs-nxp.c net: update NXP copyright text 2021-09-17 13:52:17 +01:00
pcs-xpcs.c net: pcs: xpcs: Return EINVAL in the internal methods 2024-04-13 13:01:43 +02:00
pcs-xpcs.h net: pcs: xpcs: add support for NXP SJA1110 2021-06-11 13:43:56 -07:00