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
This commit is contained in:
Will Huang 2019-07-24 16:53:26 +08:00 • committed by nshrivas
commit 1f79c8fbe0
2 changed files with 4 additions and 4 deletions

View file

@ -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;

View file

@ -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);