mirror of
https://github.com/ipxe/ipxe
synced 2026-02-10 10:10:21 +03:00
[netdevice] Make all net_driver methods optional
Most network upper-layer drivers do not implement all three methods (probe, notify, and remove). Save code by making all methods optional. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -439,16 +439,6 @@ int vlan_destroy ( struct net_device *netdev ) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Do nothing
|
||||
*
|
||||
* @v trunk Trunk network device
|
||||
* @ret rc Return status code
|
||||
*/
|
||||
static int vlan_probe ( struct net_device *trunk __unused ) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle trunk network device link state change
|
||||
*
|
||||
@@ -505,7 +495,6 @@ static void vlan_remove ( struct net_device *trunk ) {
|
||||
/** VLAN driver */
|
||||
struct net_driver vlan_driver __net_driver = {
|
||||
.name = "VLAN",
|
||||
.probe = vlan_probe,
|
||||
.notify = vlan_notify,
|
||||
.remove = vlan_remove,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user