The iwm_poll_bit() function in iwm(4) returns 1 on success, and 0 on
failure. So instead of "if (ret < 0) {" we should check for
"if (!ret) {".
Index: sys/dev/pci/if_iwm.c
===================================================================
RCS file: /cvs/src/sys/dev/pci/if_iwm.c,v
retrieving revision 1.99
diff -u -r1.99 if_iwm.c
--- sys/dev/pci/if_iwm.c 17 Aug 2016 09:39:38 -0000 1.99
+++ sys/dev/pci/if_iwm.c 31 Aug 2016 19:56:26 -0000
@@ -7913,7 +7913,7 @@
IWM_CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY,
IWM_CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY,
25000);
- if (ret < 0) {
+ if (!ret) {
printf("%s: Failed to wake up the nic\n", DEVNAME(sc));
return;
}