Browse Source

cnss2: Check calibration support after pci probe

Ensure the completion of pci probe before checking
whether the calibration is supported for the device id or not.

Change-Id: Ifb6b6b15c434c16822bb8a4291403e4a635f985f
CRs-Fixed: 3303831
Jayachandran Sreekumaran 2 years ago
parent
commit
e079e8958c
1 changed files with 14 additions and 13 deletions
  1. 14 13
      cnss2/main.c

+ 14 - 13
cnss2/main.c

@@ -2007,6 +2007,20 @@ static int cnss_cold_boot_cal_start_hdlr(struct cnss_plat_data *plat_priv)
 		}
 	}
 
+	switch (plat_priv->device_id) {
+	case QCA6290_DEVICE_ID:
+	case QCA6390_DEVICE_ID:
+	case QCA6490_DEVICE_ID:
+	case KIWI_DEVICE_ID:
+	case MANGO_DEVICE_ID:
+		break;
+	default:
+		cnss_pr_err("Not supported for device ID 0x%lx\n",
+			    plat_priv->device_id);
+		ret = -EINVAL;
+		goto mark_cal_fail;
+	}
+
 	set_bit(CNSS_IN_COLD_BOOT_CAL, &plat_priv->driver_state);
 	if (test_bit(CNSS_DRIVER_REGISTER, &plat_priv->driver_state)) {
 		timeout = cnss_get_timeout(plat_priv,
@@ -3531,19 +3545,6 @@ static ssize_t fs_ready_store(struct device *dev,
 		return count;
 	}
 
-	switch (plat_priv->device_id) {
-	case QCA6290_DEVICE_ID:
-	case QCA6390_DEVICE_ID:
-	case QCA6490_DEVICE_ID:
-	case KIWI_DEVICE_ID:
-	case MANGO_DEVICE_ID:
-		break;
-	default:
-		cnss_pr_err("Not supported for device ID 0x%lx\n",
-			    plat_priv->device_id);
-		return count;
-	}
-
 	set_bit(CNSS_FS_READY, &plat_priv->driver_state);
 	if (fs_ready == FILE_SYSTEM_READY && plat_priv->cbc_enabled) {
 		cnss_driver_event_post(plat_priv,