Browse Source

qcacld-3.0: Register sysfs entries only for Mission mode

Some of the psoc/pdev specific sysfs entries are valid only for
mission mode and a no-op for the non-mission modes.

Add a sanity check for global mode type while adding and removing
the interface.

Change-Id: If017f583f9b3a29c7d43e59709227a9ba639764d
CRs-Fixed: 2682924
Arun Kumar Khandavalli 4 years ago
parent
commit
a04e1c5dd8
1 changed files with 8 additions and 4 deletions
  1. 8 4
      core/hdd/src/wlan_hdd_sysfs.c

+ 8 - 4
core/hdd/src/wlan_hdd_sysfs.c

@@ -653,14 +653,18 @@ void hdd_create_sysfs_files(struct hdd_context *hdd_ctx)
 {
 	hdd_sysfs_create_driver_root_obj();
 	hdd_sysfs_create_version_interface(hdd_ctx->psoc);
-	hdd_sysfs_create_powerstats_interface();
-	hdd_sysfs_set_fw_mode_cfg_create(driver_kobject);
+	if  (QDF_GLOBAL_MISSION_MODE == hdd_get_conparam()) {
+		hdd_sysfs_create_powerstats_interface();
+		hdd_sysfs_set_fw_mode_cfg_create(driver_kobject);
+	}
 }
 
 void hdd_destroy_sysfs_files(void)
 {
-	hdd_sysfs_set_fw_mode_cfg_destroy(driver_kobject);
-	hdd_sysfs_destroy_powerstats_interface();
+	if  (QDF_GLOBAL_MISSION_MODE == hdd_get_conparam()) {
+		hdd_sysfs_set_fw_mode_cfg_destroy(driver_kobject);
+		hdd_sysfs_destroy_powerstats_interface();
+	}
 	hdd_sysfs_destroy_version_interface();
 	hdd_sysfs_destroy_driver_root_obj();
 }