Skip to content

Commit 944767b

Browse files
Dimitri Fedraukuba-moo
authored andcommitted
net: phy: marvell-88q2xxx: fix typos
Rename mv88q2xxxx_get_sqi to mv88q2xxx_get_sqi and mv88q2xxxx_get_sqi_max to mv88q2xxx_get_sqi_max. Fix linebreaks and use everywhere hexadecimal numbers written with lowercase letters instead of mixing it up. Reviewed-by: Andrew Lunn <[email protected]> Signed-off-by: Dimitri Fedrau <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 8d9a577 commit 944767b

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

drivers/net/phy/marvell-88q2xxx.c

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#define MDIO_MMD_AN_MV_STAT_MS_CONF_FAULT 0x8000
1515

1616
#define MDIO_MMD_PCS_MV_100BT1_STAT1 33032
17-
#define MDIO_MMD_PCS_MV_100BT1_STAT1_IDLE_ERROR 0x00FF
17+
#define MDIO_MMD_PCS_MV_100BT1_STAT1_IDLE_ERROR 0x00ff
1818
#define MDIO_MMD_PCS_MV_100BT1_STAT1_JABBER 0x0100
1919
#define MDIO_MMD_PCS_MV_100BT1_STAT1_LINK 0x0200
2020
#define MDIO_MMD_PCS_MV_100BT1_STAT1_LOCAL_RX 0x1000
@@ -27,6 +27,8 @@
2727
#define MDIO_MMD_PCS_MV_100BT1_STAT2_LINK 0x0004
2828
#define MDIO_MMD_PCS_MV_100BT1_STAT2_ANGE 0x0008
2929

30+
#define MDIO_MMD_PCS_MV_RX_STAT 33328
31+
3032
static int mv88q2xxx_soft_reset(struct phy_device *phydev)
3133
{
3234
int ret;
@@ -63,15 +65,17 @@ static int mv88q2xxx_read_link_gbit(struct phy_device *phydev)
6365
* the link was already down.
6466
*/
6567
if (!phy_polling_mode(phydev) || !phydev->link) {
66-
ret = phy_read_mmd(phydev, MDIO_MMD_PCS, MDIO_PCS_1000BT1_STAT);
68+
ret = phy_read_mmd(phydev, MDIO_MMD_PCS,
69+
MDIO_PCS_1000BT1_STAT);
6770
if (ret < 0)
6871
return ret;
6972
else if (ret & MDIO_PCS_1000BT1_STAT_LINK)
7073
link = true;
7174
}
7275

7376
if (!link) {
74-
ret = phy_read_mmd(phydev, MDIO_MMD_PCS, MDIO_PCS_1000BT1_STAT);
77+
ret = phy_read_mmd(phydev, MDIO_MMD_PCS,
78+
MDIO_PCS_1000BT1_STAT);
7579
if (ret < 0)
7680
return ret;
7781
else if (ret & MDIO_PCS_1000BT1_STAT_LINK)
@@ -95,7 +99,8 @@ static int mv88q2xxx_read_link_100m(struct phy_device *phydev)
9599
* we always read the realtime status.
96100
*/
97101
if (!phy_polling_mode(phydev) || !phydev->link) {
98-
ret = phy_read_mmd(phydev, MDIO_MMD_PCS, MDIO_MMD_PCS_MV_100BT1_STAT1);
102+
ret = phy_read_mmd(phydev, MDIO_MMD_PCS,
103+
MDIO_MMD_PCS_MV_100BT1_STAT1);
99104
if (ret < 0)
100105
return ret;
101106
else if (ret & MDIO_MMD_PCS_MV_100BT1_STAT1_LINK)
@@ -200,15 +205,16 @@ static int mv88q2xxx_config_init(struct phy_device *phydev)
200205
return mv88q2xxx_config_aneg(phydev);
201206
}
202207

203-
static int mv88q2xxxx_get_sqi(struct phy_device *phydev)
208+
static int mv88q2xxx_get_sqi(struct phy_device *phydev)
204209
{
205210
int ret;
206211

207212
if (phydev->speed == SPEED_100) {
208213
/* Read the SQI from the vendor specific receiver status
209214
* register
210215
*/
211-
ret = phy_read_mmd(phydev, MDIO_MMD_PCS, 0x8230);
216+
ret = phy_read_mmd(phydev, MDIO_MMD_PCS,
217+
MDIO_MMD_PCS_MV_RX_STAT);
212218
if (ret < 0)
213219
return ret;
214220

@@ -218,7 +224,7 @@ static int mv88q2xxxx_get_sqi(struct phy_device *phydev)
218224
* but can be found in the Software Initialization Guide. Only
219225
* revisions >= A0 are supported.
220226
*/
221-
ret = phy_modify_mmd(phydev, MDIO_MMD_PCS, 0xFC5D, 0x00FF, 0x00AC);
227+
ret = phy_modify_mmd(phydev, MDIO_MMD_PCS, 0xfc5d, 0xff, 0xac);
222228
if (ret < 0)
223229
return ret;
224230

@@ -227,10 +233,10 @@ static int mv88q2xxxx_get_sqi(struct phy_device *phydev)
227233
return ret;
228234
}
229235

230-
return ret & 0x0F;
236+
return ret & 0x0f;
231237
}
232238

233-
static int mv88q2xxxx_get_sqi_max(struct phy_device *phydev)
239+
static int mv88q2xxx_get_sqi_max(struct phy_device *phydev)
234240
{
235241
return 15;
236242
}
@@ -246,8 +252,8 @@ static struct phy_driver mv88q2xxx_driver[] = {
246252
.read_status = mv88q2xxx_read_status,
247253
.soft_reset = mv88q2xxx_soft_reset,
248254
.set_loopback = genphy_c45_loopback,
249-
.get_sqi = mv88q2xxxx_get_sqi,
250-
.get_sqi_max = mv88q2xxxx_get_sqi_max,
255+
.get_sqi = mv88q2xxx_get_sqi,
256+
.get_sqi_max = mv88q2xxx_get_sqi_max,
251257
},
252258
};
253259

0 commit comments

Comments
 (0)