net: dsa: mv88e6xxx: Take switch out of reset before probe
authorAndrew Lunn <andrew@lunn.ch>
Mon, 21 Nov 2016 22:26:55 +0000 (23:26 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 22 Nov 2016 14:55:30 +0000 (09:55 -0500)
The switch needs to be taken out of reset before we can read its ID
register on the MDIO bus.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/mv88e6xxx/chip.c

index e30d0eaf2b5f1f6b8434af30009ca7ec4fe0e271..062b9128a58d772ecc1b72daeaca2a73e89af570 100644 (file)
@@ -3855,16 +3855,16 @@ static int mv88e6xxx_probe(struct mdio_device *mdiodev)
        if (err)
                return err;
 
+       chip->reset = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW);
+       if (IS_ERR(chip->reset))
+               return PTR_ERR(chip->reset);
+
        err = mv88e6xxx_detect(chip);
        if (err)
                return err;
 
        mv88e6xxx_phy_init(chip);
 
-       chip->reset = devm_gpiod_get_optional(dev, "reset", GPIOD_ASIS);
-       if (IS_ERR(chip->reset))
-               return PTR_ERR(chip->reset);
-
        if (chip->info->ops->get_eeprom &&
            !of_property_read_u32(np, "eeprom-length", &eeprom_len))
                chip->eeprom_len = eeprom_len;