[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

@@ -375,16 +375,6 @@ int neighbour_define ( struct net_device *netdev,
return 0;
}
/**
* Update neighbour cache on network device creation
*
* @v netdev Network device
*/
static int neighbour_probe ( struct net_device *netdev __unused ) {
/* Nothing to do */
return 0;
}
/**
* Update neighbour cache on network device state change or removal
*
@@ -404,7 +394,6 @@ static void neighbour_flush ( struct net_device *netdev ) {
/** Neighbour driver (for net device notifications) */
struct net_driver neighbour_net_driver __net_driver = {
.name = "Neighbour",
.probe = neighbour_probe,
.notify = neighbour_flush,
.remove = neighbour_flush,
};