Index: /trunk/src/VBox/Devices/Audio/DevHDA.cpp
===================================================================
--- /trunk/src/VBox/Devices/Audio/DevHDA.cpp	(revision 65061)
+++ /trunk/src/VBox/Devices/Audio/DevHDA.cpp	(revision 65062)
@@ -981,10 +981,4 @@
 /** @} */
 
-/* Locking + logging. */
-#ifdef IN_RING3
-DECLINLINE(int)  hdaRegWriteSDLock(PHDASTATE pThis, PHDASTREAM pStream, uint32_t iReg, uint32_t u32Value);
-DECLINLINE(void) hdaRegWriteSDUnlock(PHDASTREAM pStream);
-#endif
-
 /** @name Generic register read/write functions.
  * @{
@@ -1260,4 +1254,5 @@
 
 
+#ifdef IN_RING3
 /**
  * Retrieves the number of bytes of a FIFOW register.
@@ -1281,5 +1276,4 @@
 
 
-#ifdef IN_RING3
 DECLINLINE(uint32_t) hdaStreamUpdateLPIB(PHDASTATE pThis, PHDASTREAM pStream, uint32_t u32LPIB)
 {
@@ -2434,5 +2428,7 @@
     hdaProcessInterrupt(pThis);
 
-    hdaRegWriteSDUnlock(pStream);
+    rc2 = RTCritSectLeave(&pStream->State.CritSect);
+    AssertRC(rc2);
+
     return VINF_SUCCESS; /* Always return success to the MMIO handler. */
 #else  /* !IN_RING3 */
@@ -2991,47 +2987,4 @@
     return hdaRegWriteSDBDPX(pThis, iReg, u32Value, HDA_SD_NUM_FROM_REG(pThis, BDPU, iReg));
 }
-
-#ifdef IN_RING3
-/**
- * XXX
- *
- * @return  VBox status code.  ALL THE CALLERS IGNORES THIS. DUH.
- *
- * @param   pThis               Pointer to HDA state.
- * @param   iReg                Register to write (logging only).
- * @param   u32Value            Value to write (logging only).
- */
-DECLINLINE(int) hdaRegWriteSDLock(PHDASTATE pThis, PHDASTREAM pStream, uint32_t iReg, uint32_t u32Value)
-{
-    RT_NOREF(pThis, iReg, u32Value);
-    AssertPtr(pThis);   /* don't bother returning errors */
-    AssertPtr(pStream);
-
-# ifdef VBOX_STRICT
-    /* Check if the SD's RUN bit is set. */
-    uint32_t u32SDCTL = HDA_STREAM_REG(pThis, CTL, pStream->u8SD);
-    bool fIsRunning   = RT_BOOL(u32SDCTL & HDA_REG_FIELD_FLAG_MASK(SDCTL, RUN));
-    if (fIsRunning)
-    {
-        LogFunc(("[SD%RU8]: Warning: Cannot write to register 0x%x (0x%x) when RUN bit is set (%R[sdctl])\n",
-                 pStream->u8SD, iReg, u32Value, u32SDCTL));
-#  ifdef DEBUG_andy
-        AssertFailed();
-#  endif
-        return VERR_ACCESS_DENIED;
-    }
-# endif
-
-    return RTCritSectEnter(&pStream->State.CritSect);
-}
-
-DECLINLINE(void) hdaRegWriteSDUnlock(PHDASTREAM pStream)
-{
-    AssertPtrReturnVoid(pStream);
-
-    int rc2 = RTCritSectLeave(&pStream->State.CritSect);
-    AssertRC(rc2);
-}
-#endif /* IN_RING3 */
 
 static int hdaRegReadIRS(PHDASTATE pThis, uint32_t iReg, uint32_t *pu32Value)
