From: Andrew Lunn Date: Fri, 27 Mar 2015 01:36:41 +0000 (-0700) Subject: net: dsa: mv88e6171: Add defines for switch product IDs X-Git-Tag: v5.15~15978^2~124^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=464caa2f5ba8d937ce3d434b1be4179fefb011e5;p=platform%2Fkernel%2Flinux-starfive.git 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 Reviewed-by: Guenter Roeck Signed-off-by: Guenter Roeck Signed-off-by: David S. Miller --- diff --git a/drivers/net/dsa/mv88e6171.c b/drivers/net/dsa/mv88e6171.c index 6ce6a3e..54ebfed 100644 --- a/drivers/net/dsa/mv88e6171.c +++ b/drivers/net/dsa/mv88e6171.c @@ -17,6 +17,10 @@ #include #include "mv88e6xxx.h" +/* Switch product IDs */ +#define ID_6171 0x1710 +#define ID_6172 0x1720 + static char *mv88e6171_probe(struct device *host_dev, int sw_addr) { 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) ret = __mv88e6xxx_reg_read(bus, sw_addr, REG_PORT(0), 0x03); if (ret >= 0) { - if ((ret & 0xfff0) == 0x1710) + if ((ret & 0xfff0) == ID_6171) return "Marvell 88E6171"; - if ((ret & 0xfff0) == 0x1720) + if ((ret & 0xfff0) == ID_6172) return "Marvell 88E6172"; }