Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8790e2d7 authored by CNSS_WLAN Service's avatar CNSS_WLAN Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "wlan: Release reference to smem state" into wlan-driver.lnx.1.0

parents a450ca53 bba8fb61
Loading
Loading
Loading
Loading
+17 −11
Original line number Diff line number Diff line
@@ -760,6 +760,18 @@ wpt_status wpalDeviceInit
   gpEnv->tx_registered = 0;
   gpEnv->rx_registered = 0;

#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0))
   g_smem_state.tx_enable_state = qcom_smem_state_get(wcnss_device,
                                      "tx-enable",
                                      &g_smem_state.tx_enable_state_bit);
   if (IS_ERR(g_smem_state.tx_enable_state)) {
       WPAL_TRACE(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR,
                 "%s: qcom_smem_state_get failed", __func__);

      goto err_ioremap;
   }
#endif

   /* successfully allocated environment, memory and IRQs */
   return eWLAN_PAL_STATUS_SUCCESS;

@@ -793,6 +805,11 @@ wpt_status wpalDeviceClose
      return eWLAN_PAL_STATUS_E_INVAL;
   }

#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0))
   qcom_smem_state_put(g_smem_state.tx_enable_state);
   memset(&g_smem_state, 0, sizeof(g_smem_state));
#endif

   if (gpEnv->rx_registered)
   {
      free_irq(gpEnv->rx_irq, gpEnv);
@@ -825,17 +842,6 @@ wpt_status wpalNotifySmsm
{
   int rc;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0))
   struct device *dev = (struct device *)gContext.devHandle;

   g_smem_state.tx_enable_state = qcom_smem_state_get(dev, "tx-enable",
					&g_smem_state.tx_enable_state_bit);
   if (IS_ERR(g_smem_state.tx_enable_state)) {
      WPAL_TRACE(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR,
                 "%s: qcom_smem_state_get failed", __func__);

      return eWLAN_PAL_STATUS_E_FAILURE;
   }

   rc =  qcom_smem_state_update_bits(g_smem_state.tx_enable_state,
                                     clrSt, setSt);
#else