Commit 937a9440 authored by Joe Perches's avatar Joe Perches Committed by David S. Miller

net: ethernet: mediatek: Fix misuses of GENMASK macro

Arguments are supposed to be ordered high then low.
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 63f9ba1b
...@@ -723,7 +723,7 @@ struct mtk_soc_data { ...@@ -723,7 +723,7 @@ struct mtk_soc_data {
#define MTK_MAX_DEVS 2 #define MTK_MAX_DEVS 2
#define MTK_SGMII_PHYSPEED_AN BIT(31) #define MTK_SGMII_PHYSPEED_AN BIT(31)
#define MTK_SGMII_PHYSPEED_MASK GENMASK(0, 2) #define MTK_SGMII_PHYSPEED_MASK GENMASK(2, 0)
#define MTK_SGMII_PHYSPEED_1000 BIT(0) #define MTK_SGMII_PHYSPEED_1000 BIT(0)
#define MTK_SGMII_PHYSPEED_2500 BIT(1) #define MTK_SGMII_PHYSPEED_2500 BIT(1)
#define MTK_HAS_FLAGS(flags, _x) (((flags) & (_x)) == (_x)) #define MTK_HAS_FLAGS(flags, _x) (((flags) & (_x)) == (_x))
......
...@@ -82,7 +82,7 @@ int mtk_sgmii_setup_mode_force(struct mtk_sgmii *ss, int id) ...@@ -82,7 +82,7 @@ int mtk_sgmii_setup_mode_force(struct mtk_sgmii *ss, int id)
return -EINVAL; return -EINVAL;
regmap_read(ss->regmap[id], ss->ana_rgc3, &val); regmap_read(ss->regmap[id], ss->ana_rgc3, &val);
val &= ~GENMASK(2, 3); val &= ~GENMASK(3, 2);
mode = ss->flags[id] & MTK_SGMII_PHYSPEED_MASK; mode = ss->flags[id] & MTK_SGMII_PHYSPEED_MASK;
val |= (mode == MTK_SGMII_PHYSPEED_1000) ? 0 : BIT(2); val |= (mode == MTK_SGMII_PHYSPEED_1000) ? 0 : BIT(2);
regmap_write(ss->regmap[id], ss->ana_rgc3, val); regmap_write(ss->regmap[id], ss->ana_rgc3, val);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment