linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ping-Ke Shih <pkshih@realtek.com>
To: <kvalo@kernel.org>
Cc: <linux-wireless@vger.kernel.org>
Subject: [PATCH v3 4/4] rtw89: pci: correct return value handling of rtw89_write16_mdio_mask()
Date: Wed, 13 Apr 2022 09:08:04 +0800	[thread overview]
Message-ID: <20220413010804.8941-5-pkshih@realtek.com> (raw)
In-Reply-To: <20220413010804.8941-1-pkshih@realtek.com>

Fix wrong checking statement. Fortunately, this wrong code doesn't affect
existing chip.

Fixes: 740c431c22fe ("rtw89: pci: add register definition to rtw89_pci_info to generalize pci code")
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
---
 drivers/net/wireless/realtek/rtw89/pci.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtw89/pci.c b/drivers/net/wireless/realtek/rtw89/pci.c
index dcf907b81cffa..ecb419010f0c2 100644
--- a/drivers/net/wireless/realtek/rtw89/pci.c
+++ b/drivers/net/wireless/realtek/rtw89/pci.c
@@ -1522,7 +1522,7 @@ rtw89_write16_mdio_mask(struct rtw89_dev *rtwdev, u8 addr, u16 mask, u16 data, u
 	u16 val;
 
 	ret = rtw89_read16_mdio(rtwdev, addr, speed, &val);
-	if (!ret)
+	if (ret)
 		return ret;
 
 	shift = __ffs(mask);
@@ -1530,7 +1530,7 @@ rtw89_write16_mdio_mask(struct rtw89_dev *rtwdev, u8 addr, u16 mask, u16 data, u
 	val |= ((data << shift) & mask);
 
 	ret = rtw89_write16_mdio(rtwdev, addr, val, speed);
-	if (!ret)
+	if (ret)
 		return ret;
 
 	return 0;
-- 
2.25.1


      parent reply	other threads:[~2022-04-13  1:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-13  1:08 [PATCH v3 0/4] rtw89: refine interrupt masks for SER, and add H2C for new chip Ping-Ke Shih
2022-04-13  1:08 ` [PATCH v3 1/4] rtw89: extend H2C of CMAC control info Ping-Ke Shih
2022-04-13  6:27   ` Kalle Valo
2022-04-13  1:08 ` [PATCH v3 2/4] rtw89: add new H2C to configure security CAM via DCTL for V1 chip Ping-Ke Shih
2022-04-13  1:08 ` [PATCH v3 3/4] rtw89: configure security CAM " Ping-Ke Shih
2022-04-13  1:08 ` Ping-Ke Shih [this message]

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=20220413010804.8941-5-pkshih@realtek.com \
    --to=pkshih@realtek.com \
    --cc=kvalo@kernel.org \
    --cc=linux-wireless@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;
as well as URLs for NNTP newsgroup(s).