kfree(rule);
}
+static void igc_flush_nfc_rules(struct igc_adapter *adapter)
+{
+ struct igc_nfc_rule *rule, *tmp;
+
+ spin_lock(&adapter->nfc_rule_lock);
+
+ list_for_each_entry_safe(rule, tmp, &adapter->nfc_rule_list, list)
+ igc_del_nfc_rule(adapter, rule);
+
+ spin_unlock(&adapter->nfc_rule_lock);
+}
+
/**
* igc_add_nfc_rule() - Add NFC rule
* @adapter: Pointer to adapter
if (!(changed & (NETIF_F_RXALL | NETIF_F_NTUPLE)))
return 0;
- if (!(features & NETIF_F_NTUPLE)) {
- struct igc_nfc_rule *rule, *tmp;
-
- spin_lock(&adapter->nfc_rule_lock);
- list_for_each_entry_safe(rule, tmp,
- &adapter->nfc_rule_list, list) {
- igc_disable_nfc_rule(adapter, rule);
- list_del(&rule->list);
- kfree(rule);
- }
- spin_unlock(&adapter->nfc_rule_lock);
- adapter->nfc_rule_count = 0;
- }
+ if (!(features & NETIF_F_NTUPLE))
+ igc_flush_nfc_rules(adapter);
netdev->features = features;
pm_runtime_get_noresume(&pdev->dev);
+ igc_flush_nfc_rules(adapter);
+
igc_ptp_stop(adapter);
set_bit(__IGC_DOWN, &adapter->state);