diff --git a/sys/dev/hyperv/vmbus/vmbus.c b/sys/dev/hyperv/vmbus/vmbus.c --- a/sys/dev/hyperv/vmbus/vmbus.c +++ b/sys/dev/hyperv/vmbus/vmbus.c @@ -136,8 +136,6 @@ static int vmbus_intr_setup(struct vmbus_softc *); static void vmbus_intr_teardown(struct vmbus_softc *); static int vmbus_doattach(struct vmbus_softc *); -static void vmbus_event_proc_dummy(struct vmbus_softc *, - int); static struct vmbus_softc *vmbus_sc; SYSCTL_NODE(_hw, OID_AUTO, vmbus, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, @@ -684,7 +682,8 @@ * As recommended by the Windows guest fellows, we check events before * checking messages. */ - sc->vmbus_event_proc(sc, cpu); + if (sc->vmbus_event_proc != NULL) + sc->vmbus_event_proc(sc, cpu); /* * Check messages. Mainly management stuffs; ultra low rate. @@ -1483,11 +1482,6 @@ return (ret); } -static void -vmbus_event_proc_dummy(struct vmbus_softc *sc __unused, int cpu __unused) -{ -} - #if defined(EARLY_AP_STARTUP) || defined(__aarch64__) static void @@ -1506,16 +1500,14 @@ static int vmbus_attach(device_t dev) { - vmbus_sc = device_get_softc(dev); - vmbus_sc->vmbus_dev = dev; - vmbus_sc->vmbus_idtvec = -1; - /* * Event processing logic will be configured: * - After the vmbus protocol version negotiation. * - Before we request channel offers. */ - vmbus_sc->vmbus_event_proc = vmbus_event_proc_dummy; + vmbus_sc = device_get_softc(dev); + vmbus_sc->vmbus_dev = dev; + vmbus_sc->vmbus_idtvec = -1; #if defined(EARLY_AP_STARTUP) || defined(__aarch64__) /*