diff --git a/sys/dev/iwm/if_iwm.c b/sys/dev/iwm/if_iwm.c index 4c64bd916fe2..99f0d578afcf 100644 --- a/sys/dev/iwm/if_iwm.c +++ b/sys/dev/iwm/if_iwm.c @@ -5743,8 +5743,6 @@ iwm_pci_detach(device_t dev) rman_get_rid(sc->sc_mem), sc->sc_mem); } - - static int iwm_attach(device_t dev) { @@ -5761,6 +5759,10 @@ iwm_attach(device_t dev) callout_init_mtx(&sc->sc_led_blink_to, &sc->sc_mtx, 0); TASK_INIT(&sc->sc_es_task, 0, iwm_endscan_cb, sc); + error = iwm_dev_check(dev); + if (error != 0) + goto fail; + sc->sc_notif_wait = iwm_notification_wait_init(sc); if (sc->sc_notif_wait == NULL) { device_printf(dev, "failed to init notification wait struct\n"); @@ -5786,11 +5788,6 @@ iwm_attach(device_t dev) sc->sc_wantresp = -1; - /* Match device id */ - error = iwm_dev_check(dev); - if (error != 0) - goto fail; - sc->sc_hw_rev = IWM_READ(sc, IWM_CSR_HW_REV); /* * In the 8000 HW family the format of the 4 bytes of CSR_HW_REV have