aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/dsa/mv88e6xxx/chip.c
diff options
context:
space:
mode:
authorVivien Didelot <vivien.didelot@savoirfairelinux.com>2016-09-02 14:45:34 -0400
committerDavid S. Miller <davem@davemloft.net>2016-09-06 12:58:14 -0700
commitca070c1097eb647e87619af5037d8a8a53a3248b (patch)
tree5898c37778b7d7075c9c84d194d9b30478d4ce3c /drivers/net/dsa/mv88e6xxx/chip.c
parentnet: dsa: mv88e6xxx: move Global2 code (diff)
downloadlinux-dev-ca070c1097eb647e87619af5037d8a8a53a3248b.tar.xz
linux-dev-ca070c1097eb647e87619af5037d8a8a53a3248b.zip
net: dsa: mv88e6xxx: make global2 code optional
Since not every chip has a Global2 set of registers, make its support optional, in which case the related functions will return -EOPNOTSUPP. This also allows to reduce the size of the mv88e6xxx driver for devices such as home routers embedding Ethernet chips without Global2 support. It is present on most recent chips, thus enable its support by default. Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa/mv88e6xxx/chip.c')
-rw-r--r--drivers/net/dsa/mv88e6xxx/chip.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index 745e1588d83c..70a812d159c9 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -3444,6 +3444,10 @@ static int mv88e6xxx_detect(struct mv88e6xxx_chip *chip)
/* Update the compatible info with the probed one */
chip->info = info;
+ err = mv88e6xxx_g2_require(chip);
+ if (err)
+ return err;
+
dev_info(chip->dev, "switch 0x%x detected: %s, revision %u\n",
chip->info->prod_num, chip->info->name, rev);