Ver código fonte

cnss2: modify the checking for Secure HW feature disabled case

qcom_smem_get() returns 'ERR_PTR(ENODEV)' when Secure HW feature
is not enabled (related kernel config: CONFIG_QCOM_SMEM), add
the checking for this case.

Change-Id: Id3c6f8407a4eb4bc2124014503cc50bb99e90235
CRs-Fixed: 3769852
Yu Wang 1 ano atrás
pai
commit
6d219d7a90
1 arquivos alterados com 2 adições e 1 exclusões
  1. 2 1
      cnss2/main.c

+ 2 - 1
cnss2/main.c

@@ -4742,7 +4742,8 @@ int cnss_wlan_hw_disable_check(struct cnss_plat_data *plat_priv)
 
 	peripheralStateInfo = qcom_smem_get(QCOM_SMEM_HOST_ANY, PERISEC_SMEM_ID, &size);
 	if (IS_ERR_OR_NULL(peripheralStateInfo)) {
-		if (PTR_ERR(peripheralStateInfo) != -ENOENT)
+		if (PTR_ERR(peripheralStateInfo) != -ENOENT &&
+		    PTR_ERR(peripheralStateInfo) != -ENODEV)
 			CNSS_ASSERT(0);
 
 		cnss_pr_dbg("Secure HW feature not enabled. ret = %d\n",