Browse Source

qcacmn: Return 0 if fail to covert channel/frequency

It is easier to just compare return value of reg_freq_to_chan/
reg_chan_to_freq with 0 to check whether the channel is valid.

Change-Id: I4124cc090d31687774d8d71fee4efc822e0a6b38
CRs-Fixed: 2496010
Will Huang 5 years ago
parent
commit
1f79c8fbe0

+ 2 - 2
umac/regulatory/core/src/reg_services_common.c

@@ -1318,7 +1318,7 @@ uint32_t reg_freq_to_chan(struct wlan_objmgr_pdev *pdev,
 
 	if (!IS_VALID_PDEV_REG_OBJ(pdev_priv_obj)) {
 		reg_err("reg pdev priv obj is NULL");
-		return QDF_STATUS_E_FAILURE;
+		return 0;
 	}
 
 	chan_list = pdev_priv_obj->cur_chan_list;
@@ -1343,7 +1343,7 @@ uint32_t reg_chan_to_freq(struct wlan_objmgr_pdev *pdev,
 
 	if (!IS_VALID_PDEV_REG_OBJ(pdev_priv_obj)) {
 		reg_err("reg pdev priv obj is NULL");
-		return QDF_STATUS_E_FAILURE;
+		return 0;
 	}
 
 	chan_list = pdev_priv_obj->cur_chan_list;

+ 2 - 2
umac/regulatory/core/src/reg_services_common.h

@@ -241,7 +241,7 @@ bool reg_is_dfs_ch(struct wlan_objmgr_pdev *pdev, uint32_t chan);
  * @pdev: Pointer to pdev
  * @freq: Channel frequency
  *
- * Return: Channel number
+ * Return: Channel number if success, otherwise 0
  */
 uint32_t reg_freq_to_chan(struct wlan_objmgr_pdev *pdev, uint32_t freq);
 
@@ -250,7 +250,7 @@ uint32_t reg_freq_to_chan(struct wlan_objmgr_pdev *pdev, uint32_t freq);
  * @pdev: Pointer to pdev
  * @chan_num: Channel number
  *
- * Return: Channel frequency
+ * Return: Channel frequency if success, otherwise 0
  */
 uint32_t reg_chan_to_freq(struct wlan_objmgr_pdev *pdev, uint32_t chan_num);