Now that we have a dedicated NDO for getting a port's parent ID, get rid of SWITCHDEV_ATTR_ID_PORT_PARENT_ID and convert all callers to use the NDO exclusively. This is a preliminary change to getting rid of switchdev_ops eventually.
Showing the changes to net/switchdev/switchdev.c (1 of 6 files). Show all
Unified · Split
| @@ -592,26 +592,6 @@ int call_switchdev_blocking_notifiers(unsigned long val, struct net_device *dev, · 591 unmodified lines | |||
| 592 | } | 592 | } |
| 593 | EXPORT_SYMBOL_GPL(call_switchdev_blocking_notifiers); | 593 | EXPORT_SYMBOL_GPL(call_switchdev_blocking_notifiers); |
| 594 | 594 | ||
| 595 | bool switchdev_port_same_parent_id(struct net_device *a, | ||
| 596 | struct net_device *b) | ||
| 597 | { | ||
| 598 | struct switchdev_attr a_attr = { | ||
| 599 | .orig_dev = a, | ||
| 600 | .id = SWITCHDEV_ATTR_ID_PORT_PARENT_ID, | ||
| 601 | }; | ||
| 602 | struct switchdev_attr b_attr = { | ||
| 603 | .orig_dev = b, | ||
| 604 | .id = SWITCHDEV_ATTR_ID_PORT_PARENT_ID, | ||
| 605 | }; | ||
| 606 | |||
| 607 | if (switchdev_port_attr_get(a, &a_attr) || | ||
| 608 | switchdev_port_attr_get(b, &b_attr)) | ||
| 609 | return false; | ||
| 610 | |||
| 611 | return netdev_phys_item_id_same(&a_attr.u.ppid, &b_attr.u.ppid); | ||
| 612 | } | ||
| 613 | EXPORT_SYMBOL_GPL(switchdev_port_same_parent_id); | ||
| 614 | |||
| 615 | static int __switchdev_handle_port_obj_add(struct net_device *dev, | 595 | static int __switchdev_handle_port_obj_add(struct net_device *dev, |
| 616 | struct switchdev_notifier_port_obj_info *port_obj_info, | 596 | struct switchdev_notifier_port_obj_info *port_obj_info, |
| 617 | bool (*check_cb)(const struct net_device *dev), | 597 | bool (*check_cb)(const struct net_device *dev), |