ASSERT_RTNL();
#ifdef SUPPORT_SYSFS
- if (!is_dp_dev(p->dev) && dp_del_if_hook)
+ if (p->port_no != ODPP_LOCAL && dp_del_if_hook)
sysfs_remove_link(&p->dp->ifobj, p->dev->name);
#endif
dp_ifinfo_notify(RTM_DELLINK, p);
synchronize_rcu();
free_snat(p);
- if (!is_dp_dev(p->dev) && dp_del_if_hook) {
+ if (is_dp_dev(p->dev)) {
+ dp_dev_destroy(p->dev);
+ if (dp_devs) {
+ struct dp_dev *dp_dev = dp_dev_priv(p->dev);
+ list_add(&dp_dev->list, dp_devs);
+ }
+ }
+ if (p->port_no != ODPP_LOCAL && dp_del_if_hook) {
dp_del_if_hook(p);
} else {
dev_put(p->dev);
- if (is_dp_dev(p->dev)) {
- dp_dev_destroy(p->dev);
- if (dp_devs) {
- struct dp_dev *dp_dev = dp_dev_priv(p->dev);
- list_add(&dp_dev->list, dp_devs);
- }
- }
kfree(p);
}