From: "Marek Behún" <kabel@kernel.org>
To: netdev@vger.kernel.org
Cc: linux-usb@vger.kernel.org, "Hayes Wang" <hayeswang@realtek.com>,
"Marek Behún" <kabel@kernel.org>
Subject: [PATCH net-next 4/5] r8152: rename r8153_phy_status to r8153_phy_status_wait
Date: Tue, 3 Nov 2020 20:22:25 +0100 [thread overview]
Message-ID: <20201103192226.2455-5-kabel@kernel.org> (raw)
In-Reply-To: <20201103192226.2455-1-kabel@kernel.org>
The idea behind r8153_phy_status function is to wait till status is of
desired value or (if desired value is zero) to wait till status if of
non-zero value. Rename this function to r8153_phy_status_wait.
Signed-off-by: Marek Behún <kabel@kernel.org>
---
drivers/net/usb/r8152.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index 905859309db4..1a427061da8e 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -3198,7 +3198,7 @@ static void r8153b_green_en(struct r8152 *tp, bool enable)
tp->ups_info.green = enable;
}
-static u16 r8153_phy_status(struct r8152 *tp, u16 desired)
+static u16 r8153_phy_status_wait(struct r8152 *tp, u16 desired)
{
u16 data;
int i;
@@ -3249,7 +3249,7 @@ static void r8153b_ups_en(struct r8152 *tp, bool enable)
ocp_data &= ~PCUT_STATUS;
usb_ocp_write_word(tp, USB_MISC_0, ocp_data);
- data = r8153_phy_status(tp, 0);
+ data = r8153_phy_status_wait(tp, 0);
switch (data) {
case PHY_STAT_PWRDN:
@@ -3262,7 +3262,7 @@ static void r8153b_ups_en(struct r8152 *tp, bool enable)
data |= BMCR_RESET;
r8152_mdio_write(tp, MII_BMCR, data);
- data = r8153_phy_status(tp, PHY_STAT_LAN_ON);
+ data = r8153_phy_status_wait(tp, PHY_STAT_LAN_ON);
fallthrough;
default:
@@ -5397,7 +5397,7 @@ static void r8153_init(struct r8152 *tp)
break;
}
- data = r8153_phy_status(tp, 0);
+ data = r8153_phy_status_wait(tp, 0);
if (tp->version == RTL_VER_03 || tp->version == RTL_VER_04 ||
tp->version == RTL_VER_05)
@@ -5409,7 +5409,7 @@ static void r8153_init(struct r8152 *tp)
r8152_mdio_write(tp, MII_BMCR, data);
}
- data = r8153_phy_status(tp, PHY_STAT_LAN_ON);
+ data = r8153_phy_status_wait(tp, PHY_STAT_LAN_ON);
r8153_u2p3en(tp, false);
@@ -5536,7 +5536,7 @@ static void r8153b_init(struct r8152 *tp)
break;
}
- data = r8153_phy_status(tp, 0);
+ data = r8153_phy_status_wait(tp, 0);
data = r8152_mdio_read(tp, MII_BMCR);
if (data & BMCR_PDOWN) {
@@ -5544,7 +5544,7 @@ static void r8153b_init(struct r8152 *tp)
r8152_mdio_write(tp, MII_BMCR, data);
}
- data = r8153_phy_status(tp, PHY_STAT_LAN_ON);
+ data = r8153_phy_status_wait(tp, PHY_STAT_LAN_ON);
r8153_u2p3en(tp, false);
--
2.26.2
next prev parent reply other threads:[~2020-11-03 19:22 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-03 19:22 [PATCH net-next 0/5] r8152 changes Marek Behún
2020-11-03 19:22 ` [PATCH net-next 1/5] r8152: use generic USB macros to define product table Marek Behún
2020-11-04 1:57 ` Hayes Wang
2020-11-04 6:02 ` Marek Behún
2020-11-04 7:14 ` Hayes Wang
2020-11-04 8:53 ` Greg KH
2020-11-03 19:22 ` [PATCH net-next 2/5] r8152: cosmetic improvement of product table macro Marek Behún
2020-11-03 19:22 ` [PATCH net-next 3/5] r8152: add MCU typed read/write functions Marek Behún
2020-11-03 21:47 ` Vladimir Oltean
2020-11-04 5:55 ` Marek Behún
2020-11-04 8:47 ` Vladimir Oltean
2020-11-04 10:25 ` Marek Behún
2020-11-04 10:35 ` Marek Behún
2020-11-04 11:00 ` Vladimir Oltean
2020-11-04 11:10 ` Marek Behún
2020-11-04 12:14 ` Vladimir Oltean
2020-11-04 21:07 ` Jakub Kicinski
2020-11-05 9:54 ` Marek Behún
2020-11-05 10:56 ` Vladimir Oltean
2020-11-05 11:30 ` Marek Behún
2020-11-05 12:06 ` Vladimir Oltean
2020-11-06 3:01 ` Hayes Wang
2020-11-06 6:39 ` Marek Behún
2020-11-06 7:39 ` Hayes Wang
2020-11-03 19:22 ` Marek Behún [this message]
2020-11-03 19:22 ` [PATCH net-next 5/5] r8152: use *_modify helpers instead of read/write combos Marek Behún
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=20201103192226.2455-5-kabel@kernel.org \
--to=kabel@kernel.org \
--cc=hayeswang@realtek.com \
--cc=linux-usb@vger.kernel.org \
--cc=netdev@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).