[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:
Michael Brown
2013-10-31 14:09:43 +00:00
parent 5e1fa5cd40
commit 5c11ff6304
6 changed files with 13 additions and 72 deletions

View File

@@ -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,
};