[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87zi5vc7im.fsf@weeman.i-did-not-set--mail-host-address--so-tickle-me>
Date: Wed, 03 Jan 2018 10:00:01 -0500
From: Vivien Didelot <vivien.didelot@...oirfairelinux.com>
To: Andrew Lunn <andrew@...n.ch>, David Miller <davem@...emloft.net>
Cc: Florian Fainelli <f.fainelli@...il.com>,
netdev <netdev@...r.kernel.org>,
Russell King <rmk+kernel@....linux.org.uk>,
Andrew Lunn <andrew@...n.ch>
Subject: Re: [PATCH net-next 4/5] net: dsa: mv88e6xxx: Add helper to determining if port has SERDES
Hi Andrew,
Andrew Lunn <andrew@...n.ch> writes:
> -int mv88e6352_serdes_power(struct mv88e6xxx_chip *chip, int port, bool on)
> +static int mv88e6352_port_has_serdes(struct mv88e6xxx_chip *chip, int port)
> {
> - int err;
> u8 cmode;
> + int err;
>
> err = mv88e6xxx_port_get_cmode(chip, port, &cmode);
> - if (err)
> - return err;
> + if (err) {
> + dev_err(chip->dev, "failed to read cmode\n");
> + return 0;
> + }
>
> if ((cmode == MV88E6XXX_PORT_STS_CMODE_100BASE_X) ||
> (cmode == MV88E6XXX_PORT_STS_CMODE_1000BASE_X) ||
> - (cmode == MV88E6XXX_PORT_STS_CMODE_SGMII)) {
> + (cmode == MV88E6XXX_PORT_STS_CMODE_SGMII))
> + return 1;
> +
> + return 0;
> +}
Please use a bool for such helpers.
Thanks,
Vivien
Powered by blists - more mailing lists