]> git.saurik.com Git - apple/xnu.git/blobdiff - iokit/Kernel/IOInterruptEventSource.cpp
xnu-2050.18.24.tar.gz
[apple/xnu.git] / iokit / Kernel / IOInterruptEventSource.cpp
index 08ecc626d33d3d950c387ff12a551edd0fb0ded7..6782ec9fe7152d173f7b2a1d0824a639728e2e61 100644 (file)
@@ -167,19 +167,20 @@ void IOInterruptEventSource::disable()
 
 void IOInterruptEventSource::setWorkLoop(IOWorkLoop *inWorkLoop)
 {
-    super::setWorkLoop(inWorkLoop);
-
-    if (!provider)
-       return;
-
-    if ( !inWorkLoop ) {
-       if (intIndex >= 0) {
-           provider->unregisterInterrupt(intIndex);
+    if (inWorkLoop) super::setWorkLoop(inWorkLoop);
+
+    if (provider) {
+       if (!inWorkLoop) {
+           if (intIndex >= 0) {
+               provider->unregisterInterrupt(intIndex);
+               intIndex = ~intIndex;
+           }
+       } else if ((intIndex < 0) && (kIOReturnSuccess == registerInterruptHandler(provider, ~intIndex))) {
            intIndex = ~intIndex;
        }
-    } else if ((intIndex < 0) && (kIOReturnSuccess == registerInterruptHandler(provider, ~intIndex))) {
-       intIndex = ~intIndex;
     }
+
+    if (!inWorkLoop) super::setWorkLoop(inWorkLoop);
 }
 
 const IOService *IOInterruptEventSource::getProvider() const