[HAL][OSPI] Fix issue related to second XSPI instance management inside XSPIM. Second instance is wrongly deactivate in case of DQS not use
diff --git a/Src/stm32l4xx_hal_ospi.c b/Src/stm32l4xx_hal_ospi.c
index f92a91e..bf3e07c 100644
--- a/Src/stm32l4xx_hal_ospi.c
+++ b/Src/stm32l4xx_hal_ospi.c
@@ -1145,7 +1145,8 @@
         *((__IO uint8_t *)data_reg) = *hospi->pBuffPtr;
         hospi->pBuffPtr++;
         hospi->XferCount--;
-      } while (hospi->XferCount > 0U);
+      }
+      while (hospi->XferCount > 0U);
 
       if (status == HAL_OK)
       {
@@ -1238,7 +1239,8 @@
         *hospi->pBuffPtr = *((__IO uint8_t *)data_reg);
         hospi->pBuffPtr++;
         hospi->XferCount--;
-      } while (hospi->XferCount > 0U);
+      }
+      while (hospi->XferCount > 0U);
 
       if (status == HAL_OK)
       {
@@ -2596,8 +2598,9 @@
 #endif
 
     /********************* Deactivation of other instance *********************/
-    if ((cfg->ClkPort == IOM_cfg[other_instance].ClkPort) || (cfg->DQSPort == IOM_cfg[other_instance].DQSPort)     ||
-        (cfg->NCSPort == IOM_cfg[other_instance].NCSPort) || (cfg->IOLowPort == IOM_cfg[other_instance].IOLowPort) ||
+    if ((cfg->ClkPort == IOM_cfg[other_instance].ClkPort) || (cfg->NCSPort == IOM_cfg[other_instance].NCSPort) ||
+        ((cfg->DQSPort == IOM_cfg[other_instance].DQSPort) && (cfg->DQSPort != 0U)) ||
+        (cfg->IOLowPort == IOM_cfg[other_instance].IOLowPort) ||
         (cfg->IOHighPort == IOM_cfg[other_instance].IOHighPort))
     {
 #if   defined (OCTOSPIM_CR_MUXEN)