mirror of
https://github.com/ipxe/ipxe
synced 2026-01-12 08:28:37 +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:
@@ -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,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user