mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
To: gregkh@linuxfoundation.org
Cc: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: [PATCH 10/11] staging: rtl8192e: Drop large switch in rtl92e_config_rf
Date: Tue, 28 Jul 2015 23:31:46 +0200	[thread overview]
Message-ID: <1438119107-26176-11-git-send-email-mateusz.kulikowski@gmail.com> (raw)
In-Reply-To: <1438119107-26176-1-git-send-email-mateusz.kulikowski@gmail.com>

The same steps were made for each RF path independently.

Signed-off-by: Mateusz Kulikowski <mateusz.kulikowski@gmail.com>
---
 drivers/staging/rtl8192e/rtl8192e/r8190P_rtl8256.c | 69 +++-------------------
 1 file changed, 9 insertions(+), 60 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/r8190P_rtl8256.c b/drivers/staging/rtl8192e/rtl8192e/r8190P_rtl8256.c
index 194d64c..c8f25ad 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8190P_rtl8256.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8190P_rtl8256.c
@@ -122,70 +122,19 @@ bool rtl92e_config_rf(struct net_device *dev)
 
 		RetryTimes = ConstRetryTimes;
 		RF3_Final_Value = 0;
-		switch (eRFPath) {
-		case RF90_PATH_A:
-			while (RF3_Final_Value != RegValueToBeCheck &&
-			       RetryTimes != 0) {
-				ret = rtl92e_config_rf_path(dev,
-						(enum rf90_radio_path)eRFPath);
-				RF3_Final_Value = rtl92e_get_rf_reg(dev,
-						 (enum rf90_radio_path)eRFPath,
-						 RegOffSetToBeCheck,
-						 bMask12Bits);
-				RT_TRACE(COMP_RF,
-					 "RF %d %d register final value: %x\n",
-					 eRFPath, RegOffSetToBeCheck,
-					 RF3_Final_Value);
-				RetryTimes--;
-			}
-			break;
-		case RF90_PATH_B:
-			while (RF3_Final_Value != RegValueToBeCheck &&
-			       RetryTimes != 0) {
-				ret = rtl92e_config_rf_path(dev,
+		while (RF3_Final_Value != RegValueToBeCheck &&
+		       RetryTimes != 0) {
+			ret = rtl92e_config_rf_path(dev,
 						(enum rf90_radio_path)eRFPath);
-				RF3_Final_Value = rtl92e_get_rf_reg(dev,
-						 (enum rf90_radio_path)eRFPath,
-						 RegOffSetToBeCheck,
-						 bMask12Bits);
-				RT_TRACE(COMP_RF,
-					 "RF %d %d register final value: %x\n",
-					 eRFPath, RegOffSetToBeCheck,
-					 RF3_Final_Value);
-				RetryTimes--;
-			}
-			break;
-		case RF90_PATH_C:
-			while (RF3_Final_Value != RegValueToBeCheck &&
-			       RetryTimes != 0) {
-				ret = rtl92e_config_rf_path(dev,
-						(enum rf90_radio_path)eRFPath);
-				RF3_Final_Value = rtl92e_get_rf_reg(dev,
+			RF3_Final_Value = rtl92e_get_rf_reg(dev,
 						(enum rf90_radio_path)eRFPath,
 						RegOffSetToBeCheck,
 						bMask12Bits);
-				RT_TRACE(COMP_RF,
-					 "RF %d %d register final value: %x\n",
-					 eRFPath, RegOffSetToBeCheck,
-					 RF3_Final_Value);
-				RetryTimes--;
-			}
-			break;
-		case RF90_PATH_D:
-			while (RF3_Final_Value != RegValueToBeCheck &&
-			       RetryTimes != 0) {
-				ret = rtl92e_config_rf_path(dev,
-					       (enum rf90_radio_path)eRFPath);
-				RF3_Final_Value = rtl92e_get_rf_reg(dev,
-					       (enum rf90_radio_path)eRFPath,
-					       RegOffSetToBeCheck, bMask12Bits);
-				RT_TRACE(COMP_RF,
-					 "RF %d %d register final value: %x\n",
-					 eRFPath, RegOffSetToBeCheck,
-					 RF3_Final_Value);
-				RetryTimes--;
-			}
-			break;
+			RT_TRACE(COMP_RF,
+				 "RF %d %d register final value: %x\n",
+				 eRFPath, RegOffSetToBeCheck,
+				 RF3_Final_Value);
+			RetryTimes--;
 		}
 
 		switch (eRFPath) {
-- 
1.8.4.1


  parent reply	other threads:[~2015-07-28 21:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-28 21:31 [PATCH 00/11] staging: rtl8192e: More cleanups Mateusz Kulikowski
2015-07-28 21:31 ` [PATCH 01/11] staging: rtl8192e: Remove rtl8192_phy_updateInitGain Mateusz Kulikowski
2015-07-28 21:31 ` [PATCH 02/11] staging: rtl8192e: Remove ActUpdateChannelAccessSetting Mateusz Kulikowski
2015-07-28 21:31 ` [PATCH 03/11] staging: rtl8192e: Remove rtl8192_data_hard_stop Mateusz Kulikowski
2015-07-28 21:31 ` [PATCH 04/11] staging: rtl8192e: Remove rtl8192_data_hard_resume Mateusz Kulikowski
2015-07-28 21:31 ` [PATCH 05/11] staging: rtl8192e: MgntActSet_RF_State: remove ProtectOrNot parameter Mateusz Kulikowski
2015-07-28 21:31 ` [PATCH 06/11] staging: rtl8192e: Simplify rtl92e_is_halfn_supported_by_ap Mateusz Kulikowski
2015-07-28 21:31 ` [PATCH 07/11] staging: rtl8192e: Simplify rtl92e_set_bandwidth Mateusz Kulikowski
2015-07-28 21:31 ` [PATCH 08/11] staging: rtl8192e: Remove phy_RF8256_Config_ParaFile Mateusz Kulikowski
2015-07-28 21:31 ` [PATCH 09/11] staging: rtl8192e: Fix IW_IOCTL macro Mateusz Kulikowski
2015-07-28 21:31 ` Mateusz Kulikowski [this message]
2015-07-28 21:31 ` [PATCH 11/11] staging: rtl8192e: probe: iounmap mmio when probe fails Mateusz Kulikowski

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=1438119107-26176-11-git-send-email-mateusz.kulikowski@gmail.com \
    --to=mateusz.kulikowski@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®