net: dsa: mv88e6xxx: fix error code in mv88e6390_serdes_power()
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 23 Jun 2017 15:17:04 +0000 (18:17 +0300)
committerDavid S. Miller <davem@davemloft.net>
Sun, 25 Jun 2017 15:42:33 +0000 (11:42 -0400)
We're accidentally returning the wrong variable.  "cmode" is
uninitialized at this point so it causes a static checker warning.

Fixes: 6335e9f2446b ("net: dsa: mv88e6xxx: mv88e6390X SERDES support")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/mv88e6xxx/serdes.c

index 411b4f52279252e842e7518d08c960ba1b783ae6..f3c01119b3d1a9172efb66d9c1ba8843009c7d33 100644 (file)
@@ -192,7 +192,7 @@ int mv88e6390_serdes_power(struct mv88e6xxx_chip *chip, int port, bool on)
 
        err = mv88e6xxx_port_get_cmode(chip, port, &cmode);
        if (err)
-               return cmode;
+               return err;
 
        switch (port) {
        case 2: