diff options
author | Andrew Lunn <andrew@lunn.ch> | 2015-03-26 21:36:41 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-03-29 16:23:56 -0400 |
commit | 464caa2f5ba8d937ce3d434b1be4179fefb011e5 (patch) | |
tree | 1ccfbba4633644c16520e991fb243158e4e7d27b | |
parent | a8f064c602cf0170d41274e173a26151d7520dbe (diff) |
net: dsa: mv88e6171: Add defines for switch product IDs
Make the code more readable by using defines for the switch IDs.
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/dsa/mv88e6171.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/net/dsa/mv88e6171.c b/drivers/net/dsa/mv88e6171.c index 6ce6a3ea1b8d..54ebfed1b938 100644 --- a/drivers/net/dsa/mv88e6171.c +++ b/drivers/net/dsa/mv88e6171.c | |||
@@ -17,6 +17,10 @@ | |||
17 | #include <net/dsa.h> | 17 | #include <net/dsa.h> |
18 | #include "mv88e6xxx.h" | 18 | #include "mv88e6xxx.h" |
19 | 19 | ||
20 | /* Switch product IDs */ | ||
21 | #define ID_6171 0x1710 | ||
22 | #define ID_6172 0x1720 | ||
23 | |||
20 | static char *mv88e6171_probe(struct device *host_dev, int sw_addr) | 24 | static char *mv88e6171_probe(struct device *host_dev, int sw_addr) |
21 | { | 25 | { |
22 | struct mii_bus *bus = dsa_host_dev_to_mii_bus(host_dev); | 26 | struct mii_bus *bus = dsa_host_dev_to_mii_bus(host_dev); |
@@ -27,9 +31,9 @@ static char *mv88e6171_probe(struct device *host_dev, int sw_addr) | |||
27 | 31 | ||
28 | ret = __mv88e6xxx_reg_read(bus, sw_addr, REG_PORT(0), 0x03); | 32 | ret = __mv88e6xxx_reg_read(bus, sw_addr, REG_PORT(0), 0x03); |
29 | if (ret >= 0) { | 33 | if (ret >= 0) { |
30 | if ((ret & 0xfff0) == 0x1710) | 34 | if ((ret & 0xfff0) == ID_6171) |
31 | return "Marvell 88E6171"; | 35 | return "Marvell 88E6171"; |
32 | if ((ret & 0xfff0) == 0x1720) | 36 | if ((ret & 0xfff0) == ID_6172) |
33 | return "Marvell 88E6172"; | 37 | return "Marvell 88E6172"; |
34 | } | 38 | } |
35 | 39 | ||