static int mv88e6xxx_serdes_power(struct mv88e6xxx_chip *chip, int port,
bool on)
{
- int err = 0;
-
- if (chip->info->ops->serdes_power) {
- err = chip->info->ops->serdes_power(chip, port, on);
- if (err)
- dev_err(chip->dev,
- "Failed to change SERDES power: %d\n", err);
- }
+ if (chip->info->ops->serdes_power)
+ return chip->info->ops->serdes_power(chip, port, on);
- return err;
+ return 0;
}
static int mv88e6xxx_setup_port(struct mv88e6xxx_chip *chip, int port)
struct phy_device *phydev)
{
struct mv88e6xxx_chip *chip = ds->priv;
- int err = 0;
+ int err;
mutex_lock(&chip->reg_lock);
- mv88e6xxx_serdes_power(chip, port, true);
+ err = mv88e6xxx_serdes_power(chip, port, true);
mutex_unlock(&chip->reg_lock);
return err;
struct mv88e6xxx_chip *chip = ds->priv;
mutex_lock(&chip->reg_lock);
- mv88e6xxx_serdes_power(chip, port, false);
+ if (mv88e6xxx_serdes_power(chip, port, false))
+ dev_err(chip->dev, "failed to power off SERDES\n");
mutex_unlock(&chip->reg_lock);
}