|
@@ -472,6 +472,17 @@ bool icnss_is_pdr(void)
|
|
|
}
|
|
|
EXPORT_SYMBOL(icnss_is_pdr);
|
|
|
|
|
|
+static bool icnss_is_smp2p_valid(struct icnss_priv *priv,
|
|
|
+ enum smp2p_out_entry smp2p_entry)
|
|
|
+{
|
|
|
+ if (priv->device_id == WCN6750_DEVICE_ID ||
|
|
|
+ priv->device_id == WCN6450_DEVICE_ID ||
|
|
|
+ priv->wpss_supported)
|
|
|
+ return IS_ERR_OR_NULL(priv->smp2p_info[smp2p_entry].smem_state);
|
|
|
+ else
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
static int icnss_send_smp2p(struct icnss_priv *priv,
|
|
|
enum icnss_smp2p_msg_id msg_id,
|
|
|
enum smp2p_out_entry smp2p_entry)
|
|
@@ -479,7 +490,7 @@ static int icnss_send_smp2p(struct icnss_priv *priv,
|
|
|
unsigned int value = 0;
|
|
|
int ret;
|
|
|
|
|
|
- if (!priv || IS_ERR_OR_NULL(priv->smp2p_info[smp2p_entry].smem_state))
|
|
|
+ if (!priv || icnss_is_smp2p_valid(priv, smp2p_entry))
|
|
|
return -EINVAL;
|
|
|
|
|
|
/* No Need to check FW_DOWN for ICNSS_RESET_MSG */
|
|
@@ -810,7 +821,7 @@ retry:
|
|
|
qcom_smem_state_get(&priv->pdev->dev,
|
|
|
icnss_smp2p_str[smp2p_entry],
|
|
|
&priv->smp2p_info[smp2p_entry].smem_bit);
|
|
|
- if (IS_ERR_OR_NULL(priv->smp2p_info[smp2p_entry].smem_state)) {
|
|
|
+ if (icnss_is_smp2p_valid(priv, smp2p_entry)) {
|
|
|
if (retry++ < SMP2P_GET_MAX_RETRY) {
|
|
|
error = PTR_ERR(priv->smp2p_info[smp2p_entry].smem_state);
|
|
|
icnss_pr_err("Failed to get smem state, ret: %d Entry: %s",
|
|
@@ -5050,7 +5061,7 @@ static int icnss_pm_suspend(struct device *dev)
|
|
|
icnss_pr_vdbg("PM Suspend, state: 0x%lx\n", priv->state);
|
|
|
|
|
|
if (!priv->ops || !priv->ops->pm_suspend ||
|
|
|
- IS_ERR_OR_NULL(priv->smp2p_info[ICNSS_SMP2P_OUT_POWER_SAVE].smem_state) ||
|
|
|
+ icnss_is_smp2p_valid(priv, ICNSS_SMP2P_OUT_POWER_SAVE) ||
|
|
|
!test_bit(ICNSS_DRIVER_PROBED, &priv->state))
|
|
|
return 0;
|
|
|
|
|
@@ -5088,7 +5099,7 @@ static int icnss_pm_resume(struct device *dev)
|
|
|
icnss_pr_vdbg("PM resume, state: 0x%lx\n", priv->state);
|
|
|
|
|
|
if (!priv->ops || !priv->ops->pm_resume ||
|
|
|
- IS_ERR_OR_NULL(priv->smp2p_info[ICNSS_SMP2P_OUT_POWER_SAVE].smem_state) ||
|
|
|
+ icnss_is_smp2p_valid(priv, ICNSS_SMP2P_OUT_POWER_SAVE) ||
|
|
|
!test_bit(ICNSS_DRIVER_PROBED, &priv->state))
|
|
|
goto out;
|
|
|
|
|
@@ -5179,7 +5190,7 @@ static int icnss_pm_runtime_suspend(struct device *dev)
|
|
|
}
|
|
|
|
|
|
if (!priv->ops || !priv->ops->runtime_suspend ||
|
|
|
- IS_ERR_OR_NULL(priv->smp2p_info[ICNSS_SMP2P_OUT_POWER_SAVE].smem_state))
|
|
|
+ icnss_is_smp2p_valid(priv, ICNSS_SMP2P_OUT_POWER_SAVE))
|
|
|
goto out;
|
|
|
|
|
|
icnss_pr_vdbg("Runtime suspend\n");
|
|
@@ -5213,7 +5224,7 @@ static int icnss_pm_runtime_resume(struct device *dev)
|
|
|
}
|
|
|
|
|
|
if (!priv->ops || !priv->ops->runtime_resume ||
|
|
|
- IS_ERR_OR_NULL(priv->smp2p_info[ICNSS_SMP2P_OUT_POWER_SAVE].smem_state))
|
|
|
+ icnss_is_smp2p_valid(priv, ICNSS_SMP2P_OUT_POWER_SAVE))
|
|
|
goto out;
|
|
|
|
|
|
icnss_pr_vdbg("Runtime resume, state: 0x%lx\n", priv->state);
|