wifi: rtl8xxxu: Use local 'dev' variable for dev_warn()
PATCH v2 1/1 wifi: rtl8xxxu: Use local 'dev' variable for dev_warn()
To ensure consistent patterns, the device struct was defined and used when dev_warn() is called. This follows the logging pattern used in most of rtl8xxxu files.
--- drivers/net/wireless/realtek/rtl8xxxu/8188e.c | 3 ++- drivers/net/wireless/realtek/rtl8xxxu/8188f.c | 3 ++- drivers/net/wireless/realtek/rtl8xxxu/8192e.c | 12 ++++++---- drivers/net/wireless/realtek/rtl8xxxu/8192f.c | 9 ++++--- drivers/net/wireless/realtek/rtl8xxxu/8723a.c | 3 ++- drivers/net/wireless/realtek/rtl8xxxu/8723b.c | 3 ++- drivers/net/wireless/realtek/rtl8xxxu/core.c | 24 ++++++++++++------- 7 files changed, 38 insertions(+), 19 deletions(-)
drivers/net/wireless/realtek/rtl8xxxu/8188e.c +2 -1
@@ -643,6 +643,7 @@ static int rtl8188eu_iqk_path_a(struct rtl8xxxu_priv *priv)static int rtl8188eu_rx_iqk_path_a (struct rtl8xxxu_priv *priv) { +struct device *dev = &priv->udev->dev;u32 reg_ea4, reg_eac, reg_e94, reg_e9c, val32;int result =0 ;
@@ -740,7 +741,7 @@ static int rtl8188eu_rx_iqk_path_a(struct rtl8xxxu_priv *priv) ((reg_eac & 0x03ff0000) != 0x00360000)) result |=0x02 ; else - dev_warn(&priv->udev->dev, "%s: Path A RX IQK failed!\n", + dev_warn(dev, "%s: Path A RX IQK failed!\n", __func__); out:
drivers/net/wireless/realtek/rtl8xxxu/8188f.c +2 -1
@@ -789,6 +789,7 @@ static int rtl8188fu_init_phy_rf(struct rtl8xxxu_priv *priv)void rtl8188f_phy_lc_calibrate (struct rtl8xxxu_priv *priv) { +struct device *dev = &priv->udev->dev;u32 val32;u32 rf_amode, lstf;int i;
@@ -819,7 +820,7 @@ void rtl8188f_phy_lc_calibrate(struct rtl8xxxu_priv *priv) }if (i ==100 ) -dev_warn (&priv->udev->dev,"LC calibration timed out.\n" ); +dev_warn (dev,"LC calibration timed out.\n" );rtl8xxxu_write_rfreg (priv,RF_A ,RF6052_REG_MODE_AG , rf_amode);
drivers/net/wireless/realtek/rtl8xxxu/8192e.c +8 -4
@@ -742,6 +742,7 @@ static int rtl8192eu_iqk_path_a(struct rtl8xxxu_priv *priv)static int rtl8192eu_rx_iqk_path_a (struct rtl8xxxu_priv *priv) { +struct device *dev = &priv->udev->dev;u32 reg_ea4, reg_eac, reg_e94, reg_e9c, val32;int result =0 ;
@@ -860,7 +861,7 @@ static int rtl8192eu_rx_iqk_path_a(struct rtl8xxxu_priv *priv) ((reg_eac & 0x03ff0000) != 0x00360000)) result |=0x02 ; else - dev_warn(&priv->udev->dev, "%s: Path A RX IQK failed!\n", + dev_warn(dev, "%s: Path A RX IQK failed!\n", __func__); out:
@@ -869,6 +870,7 @@ static int rtl8192eu_rx_iqk_path_a(struct rtl8xxxu_priv *priv)static int rtl8192eu_iqk_path_b (struct rtl8xxxu_priv *priv) { +struct device *dev = &priv->udev->dev;u32 reg_eac, reg_eb4, reg_ebc;int result =0 ;
@@ -910,7 +912,7 @@ static int rtl8192eu_iqk_path_b(struct rtl8xxxu_priv *priv) ((reg_ebc & 0x03ff0000) != 0x00420000)) result |=0x01 ; else - dev_warn(&priv->udev->dev, "%s: Path B IQK failed!\n", + dev_warn(dev, "%s: Path B IQK failed!\n", __func__);return result;
@@ -918,6 +920,7 @@ static int rtl8192eu_iqk_path_b(struct rtl8xxxu_priv *priv)static int rtl8192eu_rx_iqk_path_b (struct rtl8xxxu_priv *priv) { +struct device *dev = &priv->udev->dev;u32 reg_eac, reg_eb4, reg_ebc, reg_ec4, reg_ecc, val32;int result =0 ;
@@ -1040,7 +1043,7 @@ static int rtl8192eu_rx_iqk_path_b(struct rtl8xxxu_priv *priv) ((reg_ecc & 0x03ff0000) != 0x00360000)) result |=0x02 ; else - dev_warn(&priv->udev->dev, "%s: Path B RX IQK failed!\n", + dev_warn(dev, "%s: Path B RX IQK failed!\n", __func__); out:
@@ -1495,6 +1498,7 @@ static int rtl8192eu_active_to_lps(struct rtl8xxxu_priv *priv)static int rtl8192eu_active_to_emu (struct rtl8xxxu_priv *priv) { +struct device *dev = &priv->udev->dev;u8 val8;int count, ret =0 ;
@@ -1521,7 +1525,7 @@ static int rtl8192eu_active_to_emu(struct rtl8xxxu_priv *priv) }if (!count) { -dev_warn (&priv->udev->dev,"%s: Disabling MAC timed out\n" , +dev_warn (dev,"%s: Disabling MAC timed out\n" , __func__); ret = -EBUSY ; goto exit;
drivers/net/wireless/realtek/rtl8xxxu/8192f.c +6 -3
@@ -681,6 +681,7 @@ static void rtl8192fu_init_aggregation(struct rtl8xxxu_priv *priv)static int rtl8192fu_parse_efuse (struct rtl8xxxu_priv *priv) { +struct device *dev = &priv->udev->dev;struct rtl8192fu_efuse *efuse = &priv->efuse_wifi.efuse8192fu;int i;
@@ -731,7 +732,7 @@ static int rtl8192fu_parse_efuse(struct rtl8xxxu_priv *priv) priv->rfe_type = efuse->rfe_option &0x1f ;if (priv->rfe_type !=5 && priv->rfe_type !=1 ) -dev_warn (&priv->udev->dev, +dev_warn (dev,"%s: RFE type %d was not tested. Please send an email to [email protected] about this.\n" , __func__, priv->rfe_type);
@@ -1022,6 +1023,7 @@ static int rtl8192fu_rx_iqk_path_a(struct rtl8xxxu_priv *priv)static int rtl8192fu_iqk_path_b (struct rtl8xxxu_priv *priv) { +struct device *dev = &priv->udev->dev;u32 reg_eac, reg_eb4, reg_ebc, val32;u32 rf_0x58_i, rf_0x58_q;u8 rfe = priv->rfe_type;
@@ -1109,7 +1111,7 @@ static int rtl8192fu_iqk_path_b(struct rtl8xxxu_priv *priv) ((reg_ebc & 0x03ff0000) != 0x00420000)) result |=0x01 ; else - dev_warn(&priv->udev->dev, "%s: Path B IQK failed!\n", + dev_warn(dev, "%s: Path B IQK failed!\n", __func__);return result;
@@ -1117,6 +1119,7 @@ static int rtl8192fu_iqk_path_b(struct rtl8xxxu_priv *priv)static int rtl8192fu_rx_iqk_path_b (struct rtl8xxxu_priv *priv) { +struct device *dev = &priv->udev->dev;u32 reg_eac, reg_eb4, reg_ebc, reg_ec4, reg_ecc, val32;int result =0 ;int ktime;
@@ -1246,7 +1249,7 @@ static int rtl8192fu_rx_iqk_path_b(struct rtl8xxxu_priv *priv) ((reg_ecc & 0x03ff0000) != 0x00360000)) result |=0x02 ; else - dev_warn(&priv->udev->dev, "%s: Path B RX IQK failed!\n", + dev_warn(dev, "%s: Path B RX IQK failed!\n", __func__);return result;
drivers/net/wireless/realtek/rtl8xxxu/8723a.c +2 -1
@@ -413,6 +413,7 @@ static int rtl8723au_power_on(struct rtl8xxxu_priv *priv)static int rtl8723au_active_to_emu (struct rtl8xxxu_priv *priv) { +struct device *dev = &priv->udev->dev;u8 val8;int count, ret =0 ;
@@ -439,7 +440,7 @@ static int rtl8723au_active_to_emu(struct rtl8xxxu_priv *priv) }if (!count) { -dev_warn (&priv->udev->dev,"%s: Disabling MAC timed out\n" , +dev_warn (dev,"%s: Disabling MAC timed out\n" , __func__); ret = -EBUSY ; goto exit;
drivers/net/wireless/realtek/rtl8xxxu/8723b.c +2 -1
@@ -1225,6 +1225,7 @@ static void rtl8723bu_phy_iq_calibrate(struct rtl8xxxu_priv *priv)static int rtl8723bu_active_to_emu (struct rtl8xxxu_priv *priv) { +struct device *dev = &priv->udev->dev;u8 val8;u16 val16;u32 val32;
@@ -1256,7 +1257,7 @@ static int rtl8723bu_active_to_emu(struct rtl8xxxu_priv *priv) }if (!count) { -dev_warn (&priv->udev->dev,"%s: Disabling MAC timed out\n" , +dev_warn (dev,"%s: Disabling MAC timed out\n" , __func__); ret = -EBUSY ; goto exit;
drivers/net/wireless/realtek/rtl8xxxu/core.c +16 -8
@@ -2187,6 +2187,7 @@ void rtl8xxxu_firmware_self_reset(struct rtl8xxxu_priv *priv)static int rtl8xxxu_init_mac (struct rtl8xxxu_priv *priv) { +struct device *dev = &priv->udev->dev;const struct rtl8xxxu_reg8val *array = priv->fops->mactable;int i, ret;u16 reg;
@@ -2201,7 +2202,7 @@ rtl8xxxu_init_mac(struct rtl8xxxu_priv *priv) ret =rtl8xxxu_write8 (priv, reg, val);if (ret !=1 ) { -dev_warn (&priv->udev->dev, +dev_warn (dev,"Failed to initialize MAC " "(reg: %04x, val %02x)\n" , reg, val);return -EAGAIN ;
@@ -2229,6 +2230,7 @@ rtl8xxxu_init_mac(struct rtl8xxxu_priv *priv)int rtl8xxxu_init_phy_regs (struct rtl8xxxu_priv *priv,const struct rtl8xxxu_reg32val *array) { +struct device *dev = &priv->udev->dev;int i, ret;u16 reg;u32 val;
@@ -2242,7 +2244,7 @@ int rtl8xxxu_init_phy_regs(struct rtl8xxxu_priv *priv, ret =rtl8xxxu_write32 (priv, reg, val);if (ret !=sizeof (val)) { -dev_warn (&priv->udev->dev, +dev_warn (dev,"Failed to initialize PHY\n" );return -EAGAIN ; }
@@ -2387,6 +2389,7 @@ static int rtl8xxxu_init_rf_regs(struct rtl8xxxu_priv *priv, const struct rtl8xxxu_rfregval *array, enum rtl8xxxu_rfpath path) { +struct device *dev = &priv->udev->dev;int i, ret;u8 reg;u32 val;
@@ -2421,7 +2424,7 @@ static int rtl8xxxu_init_rf_regs(struct rtl8xxxu_priv *priv, ret =rtl8xxxu_write_rfreg (priv, path, reg, val);if (ret) { -dev_warn (&priv->udev->dev, +dev_warn (dev,"Failed to initialize RF\n" );return -EAGAIN ; }
@@ -2558,6 +2561,7 @@ int rtl8xxxu_init_llt_table(struct rtl8xxxu_priv *priv)int rtl8xxxu_auto_llt_table (struct rtl8xxxu_priv *priv) { +struct device *dev = &priv->udev->dev;u32 val32;int ret =0 ;int i;
@@ -2575,7 +2579,7 @@ int rtl8xxxu_auto_llt_table(struct rtl8xxxu_priv *priv)if (!i) { ret = -EBUSY ; -dev_warn (&priv->udev->dev,"LLT table init failed\n" ); +dev_warn (dev,"LLT table init failed\n" ); }return ret;
@@ -3089,6 +3093,7 @@ void rtl8xxxu_mac_calibration(struct rtl8xxxu_priv *priv,static int rtl8xxxu_iqk_path_a (struct rtl8xxxu_priv *priv) { +struct device *dev = &priv->udev->dev;u32 reg_eac, reg_e94, reg_e9c, reg_ea4, val32;int result =0 ;
@@ -3138,7 +3143,7 @@ static int rtl8xxxu_iqk_path_a(struct rtl8xxxu_priv *priv) ((reg_eac & 0x03ff0000) != 0x00360000)) result |=0x02 ; else - dev_warn(&priv->udev->dev, "%s: Path A RX IQK failed!\n", + dev_warn(dev, "%s: Path A RX IQK failed!\n", __func__); out:return result;
@@ -3146,6 +3151,7 @@ static int rtl8xxxu_iqk_path_a(struct rtl8xxxu_priv *priv)static int rtl8xxxu_iqk_path_b (struct rtl8xxxu_priv *priv) { +struct device *dev = &priv->udev->dev;u32 reg_eac, reg_eb4, reg_ebc, reg_ec4, reg_ecc;int result =0 ;
@@ -3174,7 +3180,7 @@ static int rtl8xxxu_iqk_path_b(struct rtl8xxxu_priv *priv) (((reg_ecc & 0x03ff0000) >> 16) != 0x36)) result |=0x02 ; else - dev_warn(&priv->udev->dev, "%s: Path B RX IQK failed!\n", + dev_warn(dev, "%s: Path B RX IQK failed!\n", __func__); out:return result;
@@ -3638,6 +3644,7 @@ static void rtl8xxxu_set_ampdu_min_space(struct rtl8xxxu_priv *priv, u8 density)int rtl8xxxu_active_to_lps (struct rtl8xxxu_priv *priv) { +struct device *dev = &priv->udev->dev;u8 val8;u8 val32;int count, ret =0 ;
@@ -3655,7 +3662,7 @@ int rtl8xxxu_active_to_lps(struct rtl8xxxu_priv *priv) }if (!count) { -dev_warn (&priv->udev->dev, +dev_warn (dev,"%s: RX poll timed out (0x05f8)\n" , __func__); ret = -EBUSY ; goto exit;
@@ -5860,6 +5867,7 @@ static void rtl8xxxu_queue_rx_urb(struct rtl8xxxu_priv *priv,static void rtl8xxxu_rx_urb_work (struct work_struct *work) { +struct device *dev = &priv->udev->dev;struct rtl8xxxu_priv *priv;struct rtl8xxxu_rx_urb *rx_urb, *tmp;struct list_head local;
@@ -5893,7 +5901,7 @@ static void rtl8xxxu_rx_urb_work(struct work_struct *work)rtl8xxxu_queue_rx_urb (priv, rx_urb);break ;default : -dev_warn (&priv->udev->dev, +dev_warn (dev,"failed to requeue urb with error %i\n" , ret); skb = (struct sk_buff *)rx_urb->urb.context;dev_kfree_skb (skb);
Signature · 1 line
2.43.0
Quoted 6 lines · rafad900 <[email protected]> wrote:
To ensure consistent patterns, the device struct was defined and used when
dev_warn()is called. This follows the logging pattern used in most of rtl8xxxu files.Signed-off-by Rafael Alejandro Diaz Cruz <[email protected]>
NIPA reported many fail and warning items [1].
The tree selection should be rtw-next. e.g. [PATCH rtw-next v3]
[1] https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/
Hello Ping-Ke,
Thanks for the suggestions so far. I'm trying to find the rtw-next tree git.kernel.org but I can't seem to find it. Would you be able to provide the link so that I can pull/fetch from it plz.
I found this link, but I'm not sure if its the right one :
https://github.com/pkshih/rtw/tree/rtw-next
Thanks,
Rafael.
Quoted 17 lines · Ping-Ke Shih
Quoted 6 lines · rafad900 <[email protected]> wrote:
To ensure consistent patterns, the device struct was defined and used when
dev_warn()is called. This follows the logging pattern used in most of rtl8xxxu files.Signed-off-by Rafael Alejandro Diaz Cruz <[email protected]>NIPA reported many fail and warning items [1].
The tree selection should be rtw-next. e.g. [PATCH rtw-next v3]
[1] https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/
Quoted 7 lines · Rafael Alejandro Díaz Cruz
Hello Ping-Ke,
Thanks for the suggestions so far. I'm trying to find the rtw-next tree git.kernel.org but I can't seem to find it. Would you be able to provide the link so that I can pull/fetch from it plz.
I found this link, but I'm not sure if its the right one :
https://github.com/pkshih/rtw/tree/rtw-next
Yes. For the record, the git tree of rtl8xxxu is listed:
RTL8XXXU WIRELESS DRIVER (rtl8xxxu)
M: Jes Sorensen <[email protected]> L: [email protected] S: Maintained T: git https://github.com/pkshih/rtw.git F: drivers/net/wireless/realtek/rtl8xxxu/
Ping-Ke