Linux wireless drivers development
 help / color / mirror / Atom feed
From: Larry Finger <Larry.Finger@lwfinger.net>
To: kvalo@codeaurora.org
Cc: devel@driverdev.osuosl.org, linux-wireless@vger.kernel.org,
	Larry Finger <Larry.Finger@lwfinger.net>,
	Ping-Ke Shih <pkshih@realtek.com>
Subject: [PATCH 12/14] rtlwifi_new: rtl8192c-common: Remove all instances of DBG_EMERG
Date: Sat, 10 Dec 2016 23:45:19 -0600	[thread overview]
Message-ID: <20161211054523.7119-23-Larry.Finger@lwfinger.net> (raw)
In-Reply-To: <20161211054523.7119-1-Larry.Finger@lwfinger.net>

This is a step toward eliminating the RT_TRACE macros. Those calls that
have DBG_EMERG as the level are always logged, and they represent error
conditions, thus they are replaced with pr_err().

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Ping-Ke Shih <pkshih@realtek.com>
---
 .../wireless/realtek/rtlwifi/rtl8192c/fw_common.c  | 33 ++++++----------------
 .../wireless/realtek/rtlwifi/rtl8192c/phy_common.c | 13 ++++-----
 2 files changed, 15 insertions(+), 31 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192c/fw_common.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192c/fw_common.c
index 54fcf5a..5c93ee0 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192c/fw_common.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192c/fw_common.c
@@ -145,10 +145,8 @@ static void _rtl92c_write_fw(struct ieee80211_hw *hw,
 		pageNums = size / FW_8192C_PAGE_SIZE;
 		remainsize = size % FW_8192C_PAGE_SIZE;
 
-		if (pageNums > 4) {
-			RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-				 "Page numbers should not greater then 4\n");
-		}
+		if (pageNums > 4)
+			pr_err("Page numbers should not greater then 4\n");
 
 		for (page = 0; page < pageNums; page++) {
 			offset = page * FW_8192C_PAGE_SIZE;
@@ -180,15 +178,10 @@ static int _rtl92c_fw_free_to_go(struct ieee80211_hw *hw)
 		 (!(value32 & FWDL_ChkSum_rpt)));
 
 	if (counter >= FW_8192C_POLLING_TIMEOUT_COUNT) {
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "chksum report faill ! REG_MCUFWDL:0x%08x .\n",
-			  value32);
+		pr_err("chksum report fail! REG_MCUFWDL:0x%08x .\n",
+		       value32);
 		goto exit;
 	}
-
-	RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE,
-		 "Checksum report OK ! REG_MCUFWDL:0x%08x .\n", value32);
-
 	value32 = rtl_read_dword(rtlpriv, REG_MCUFWDL);
 	value32 |= MCUFWDL_RDY;
 	value32 &= ~WINTINI_RDY;
@@ -198,20 +191,14 @@ static int _rtl92c_fw_free_to_go(struct ieee80211_hw *hw)
 
 	do {
 		value32 = rtl_read_dword(rtlpriv, REG_MCUFWDL);
-		if (value32 & WINTINI_RDY) {
-			RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE,
-				 "Polling FW ready success!! REG_MCUFWDL:0x%08x .\n",
-					value32);
-			err = 0;
-			goto exit;
-		}
+		if (value32 & WINTINI_RDY)
+			return 0;
 
 		mdelay(FW_8192C_POLLING_DELAY);
 
 	} while (counter++ < FW_8192C_POLLING_TIMEOUT_COUNT);
 
-	RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-		 "Polling FW ready fail!! REG_MCUFWDL:0x%08x .\n", value32);
+	pr_err("Polling FW ready fail!! REG_MCUFWDL:0x%08x .\n", value32);
 
 exit:
 	return err;
@@ -251,8 +238,7 @@ int rtl92c_download_fw(struct ieee80211_hw *hw)
 
 	err = _rtl92c_fw_free_to_go(hw);
 	if (err) {
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-			 "Firmware is not ready to run!\n");
+		pr_err("Firmware is not ready to run!\n");
 	} else {
 		RT_TRACE(rtlpriv, COMP_FW, DBG_TRACE,
 			 "Firmware is ready to run!\n");
@@ -327,8 +313,7 @@ static void _rtl92c_fill_h2c_command(struct ieee80211_hw *hw,
 	while (!bwrite_sucess) {
 		wait_writeh2c_limmit--;
 		if (wait_writeh2c_limmit == 0) {
-			RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-				 "Write H2C fail because no trigger for FW INT!\n");
+			pr_err("Write H2C fail because no trigger for FW INT!\n");
 			break;
 		}
 
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192c/phy_common.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192c/phy_common.c
index 32fc4b6..fb0ce16 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192c/phy_common.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192c/phy_common.c
@@ -104,7 +104,7 @@ u32 _rtl92c_phy_rf_serial_read(struct ieee80211_hw *hw,
 	offset &= 0x3f;
 	newoffset = offset;
 	if (RT_CANNOT_IO(hw)) {
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "return all one\n");
+		pr_err("return all one\n");
 		return 0xFFFFFFFF;
 	}
 	tmplong = rtl_get_bbreg(hw, RFPGA0_XA_HSSIPARAMETER2, MASKDWORD);
@@ -152,7 +152,7 @@ void _rtl92c_phy_rf_serial_write(struct ieee80211_hw *hw,
 	struct bb_reg_def *pphyreg = &rtlphy->phyreg_def[rfpath];
 
 	if (RT_CANNOT_IO(hw)) {
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "stop\n");
+		pr_err("stop\n");
 		return;
 	}
 	offset &= 0x3f;
@@ -209,7 +209,7 @@ bool _rtl92c_phy_bb8192c_config_parafile(struct ieee80211_hw *hw)
 	rtstatus = rtlpriv->cfg->ops->config_bb_with_headerfile(hw,
 						 BASEBAND_CONFIG_PHY_REG);
 	if (!rtstatus) {
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Write BB Reg Fail!!\n");
+		pr_err("Write BB Reg Fail!!\n");
 		return false;
 	}
 	if (rtlphy->rf_type == RF_1T2R) {
@@ -222,13 +222,13 @@ bool _rtl92c_phy_bb8192c_config_parafile(struct ieee80211_hw *hw)
 						   BASEBAND_CONFIG_PHY_REG);
 	}
 	if (!rtstatus) {
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "BB_PG Reg Fail!!\n");
+		pr_err("BB_PG Reg Fail!!\n");
 		return false;
 	}
 	rtstatus = rtlpriv->cfg->ops->config_bb_with_headerfile(hw,
 						 BASEBAND_CONFIG_AGC_TAB);
 	if (!rtstatus) {
-		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "AGC Table Fail\n");
+		pr_err("AGC Table Fail\n");
 		return false;
 	}
 	rtlphy->cck_high_power =
@@ -860,8 +860,7 @@ bool _rtl92c_phy_sw_chnl_step_by_step(struct ieee80211_hw *hw,
 			currentcmd = &postcommoncmd[*step];
 			break;
 		default:
-			RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-				 "Invalid 'stage' = %d, Check it!\n", *stage);
+			pr_err("Invalid 'stage' = %d, Check it!\n", *stage);
 			return true;
 		}
 
-- 
2.10.2

  parent reply	other threads:[~2016-12-11  5:45 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-11  5:44 [PATCH 00/14] rtlwifi: Start reworking of debug system Larry Finger
2016-12-11  5:44 ` [PATCH 01/14] rtlwifi: Replace local debug macro RT_ASSERT Larry Finger
2016-12-11  5:44 ` [PATCH 02/14] rtlwifi_new: Remove RT_TRACE messages that use DBG_EMERG Larry Finger
2016-12-11 10:50   ` Joe Perches
2016-12-11 15:31     ` Larry Finger
2016-12-11  5:45 ` [PATCH 02/14] rtlwifi: " Larry Finger
2016-12-11  5:45 ` [PATCH 03/14] rtlwifi_new: rtl8821ae: Remove all instances of DBG_EMERG Larry Finger
2016-12-11  5:45 ` [PATCH 03/14] rtlwifi: " Larry Finger
2016-12-11  5:45 ` [PATCH 04/14] rtlwifi_new: rtl8723be: " Larry Finger
2016-12-11  5:45 ` [PATCH 04/14] rtlwifi: " Larry Finger
2016-12-11  5:45 ` [PATCH 05/14] rtlwifi_new: rtl8723ae: " Larry Finger
2016-12-11  5:45 ` [PATCH 05/14] rtlwifi: " Larry Finger
2016-12-11  5:45 ` [PATCH 06/14] rtlwifi_new: rtl8192ee: " Larry Finger
2016-12-11  5:45 ` [PATCH 06/14] rtlwifi: " Larry Finger
2016-12-11  5:45 ` [PATCH 07/14] rtlwifi_new: rtl8723-common: " Larry Finger
2016-12-11  5:45 ` [PATCH 07/14] rtlwifi: " Larry Finger
2016-12-11  5:45 ` [PATCH 08/14] rtlwifi_new: rtl8192se: " Larry Finger
2016-12-11  5:45 ` [PATCH 08/14] rtlwifi: " Larry Finger
2016-12-11  5:45 ` [PATCH 09/14] rtlwifi_new: rtl8192de: " Larry Finger
2016-12-11  5:45 ` [PATCH 09/14] rtlwifi: " Larry Finger
2016-12-11  5:45 ` [PATCH 10/14] rtlwifi_new: rtl8192cu: " Larry Finger
2016-12-11  5:45 ` [PATCH 10/14] rtlwifi: " Larry Finger
2016-12-11  5:45 ` [PATCH 11/14] rtlwifi_new: rtl8192ce: " Larry Finger
2016-12-11  5:45 ` [PATCH 11/14] rtlwifi: " Larry Finger
2016-12-11  5:45 ` Larry Finger [this message]
2016-12-11  5:45 ` [PATCH 12/14] rtlwifi: rtl8192c-common: " Larry Finger
2016-12-11  5:45 ` [PATCH 13/14] rtlwifi_new: rtl8188ee: " Larry Finger
2016-12-11  5:45 ` [PATCH 13/14] rtlwifi: " Larry Finger
2016-12-11  5:45 ` [PATCH 14/14] rtlwifi: Remove some redundant code Larry Finger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161211054523.7119-23-Larry.Finger@lwfinger.net \
    --to=larry.finger@lwfinger.net \
    --cc=devel@driverdev.osuosl.org \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=pkshih@realtek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox