Commit 45f1996f authored by Heiner Kallweit's avatar Heiner Kallweit Committed by David S. Miller

r8169: simplify detecting chip versions with same XID

For the GMII chip versions we set the version number which was set
already. This can be simplified.
Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b4cc2dcc
...@@ -2116,18 +2116,13 @@ static void rtl8169_get_mac_version(struct rtl8169_private *tp) ...@@ -2116,18 +2116,13 @@ static void rtl8169_get_mac_version(struct rtl8169_private *tp)
if (tp->mac_version == RTL_GIGA_MAC_NONE) { if (tp->mac_version == RTL_GIGA_MAC_NONE) {
dev_err(tp_to_dev(tp), "unknown chip XID %03x\n", reg & 0xfcf); dev_err(tp_to_dev(tp), "unknown chip XID %03x\n", reg & 0xfcf);
} else if (tp->mac_version == RTL_GIGA_MAC_VER_42) { } else if (!tp->supports_gmii) {
tp->mac_version = tp->supports_gmii ? if (tp->mac_version == RTL_GIGA_MAC_VER_42)
RTL_GIGA_MAC_VER_42 : tp->mac_version = RTL_GIGA_MAC_VER_43;
RTL_GIGA_MAC_VER_43; else if (tp->mac_version == RTL_GIGA_MAC_VER_45)
} else if (tp->mac_version == RTL_GIGA_MAC_VER_45) { tp->mac_version = RTL_GIGA_MAC_VER_47;
tp->mac_version = tp->supports_gmii ? else if (tp->mac_version == RTL_GIGA_MAC_VER_46)
RTL_GIGA_MAC_VER_45 : tp->mac_version = RTL_GIGA_MAC_VER_48;
RTL_GIGA_MAC_VER_47;
} else if (tp->mac_version == RTL_GIGA_MAC_VER_46) {
tp->mac_version = tp->supports_gmii ?
RTL_GIGA_MAC_VER_46 :
RTL_GIGA_MAC_VER_48;
} }
} }
......
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