These two functions are used to inform dash firmware that driver is been
brought up or brought down. So call these two functions only when hardware dash
function is enabled.

Signed-off-by: Chun-Hao Lin <h...@realtek.com>
---
 drivers/net/ethernet/realtek/r8169.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/realtek/r8169.c 
b/drivers/net/ethernet/realtek/r8169.c
index 305f3b4..c03891b 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -7387,9 +7387,10 @@ static void rtl_remove_one(struct pci_dev *pdev)
        struct net_device *dev = pci_get_drvdata(pdev);
        struct rtl8169_private *tp = netdev_priv(dev);
 
-       if (tp->mac_version == RTL_GIGA_MAC_VER_27 ||
-           tp->mac_version == RTL_GIGA_MAC_VER_28 ||
-           tp->mac_version == RTL_GIGA_MAC_VER_31) {
+       if ((tp->mac_version == RTL_GIGA_MAC_VER_27 ||
+            tp->mac_version == RTL_GIGA_MAC_VER_28 ||
+            tp->mac_version == RTL_GIGA_MAC_VER_31) &&
+           r8168_check_dash(tp)) {
                rtl8168_driver_stop(tp);
        }
 
@@ -7822,9 +7823,10 @@ static int rtl_init_one(struct pci_dev *pdev, const 
struct pci_device_id *ent)
                           rtl_chip_infos[chipset].jumbo_tx_csum ? "ok" : "ko");
        }
 
-       if (tp->mac_version == RTL_GIGA_MAC_VER_27 ||
-           tp->mac_version == RTL_GIGA_MAC_VER_28 ||
-           tp->mac_version == RTL_GIGA_MAC_VER_31) {
+       if ((tp->mac_version == RTL_GIGA_MAC_VER_27 ||
+            tp->mac_version == RTL_GIGA_MAC_VER_28 ||
+            tp->mac_version == RTL_GIGA_MAC_VER_31) &&
+           r8168_check_dash(tp)) {
                rtl8168_driver_start(tp);
        }
 
-- 
1.8.3.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to