• Serge Semin's avatar
    net: pcs: xpcs: Return EINVAL in the internal methods · f5151005
    Serge Semin authored
    
    
    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: default avatarSerge Semin <fancer.lancer@gmail.com>
    Tested-by: default avatarAndrew Lunn <andrew@lunn.ch>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    f5151005
pcs-xpcs.c 35.3 KB