net: pcs: xpcs: Explicitly return error on caps validation
authorSerge Semin <fancer.lancer@gmail.com>
Thu, 22 Feb 2024 17:58:23 +0000 (20:58 +0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 26 Feb 2024 13:09:09 +0000 (13:09 +0000)
commit361dd531a11bc2c63c3c906a202a9c8a7675f3e7
treecf60851b8796017258da09d7ab4f1e33e529227e
parentf5151005d379d9ce42e327fd3b2d2aaef61cda81
net: pcs: xpcs: Explicitly return error on caps validation

If an unsupported interface is passed to the PCS validation callback there
is no need in further link-modes calculations since the resultant array
will be initialized with zeros which will be perceived by the phylink
subsystem as error anyway (see phylink_validate_mac_and_pcs()). Instead
let's explicitly return the -EINVAL error to inform the caller about the
unsupported interface as it's done in the rest of the pcs_validate
callbacks.

Signed-off-by: Serge Semin <fancer.lancer@gmail.com>
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/pcs/pcs-xpcs.c