[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210601003325.1631980-8-olteanv@gmail.com>
Date: Tue, 1 Jun 2021 03:33:23 +0300
From: Vladimir Oltean <olteanv@...il.com>
To: Jakub Kicinski <kuba@...nel.org>,
"David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org
Cc: Wong Vee Khee <vee.khee.wong@...ux.intel.com>,
Ong Boon Leong <boon.leong.ong@...el.com>,
Michael Sit Wei Hong <michael.wei.hong.sit@...el.com>,
Giuseppe Cavallaro <peppe.cavallaro@...com>,
Alexandre Torgue <alexandre.torgue@...s.st.com>,
Jose Abreu <joabreu@...opsys.com>,
Maxime Coquelin <mcoquelin.stm32@...il.com>,
Heiner Kallweit <hkallweit1@...il.com>,
Russell King - ARM Linux admin <linux@...linux.org.uk>,
Florian Fainelli <f.fainelli@...il.com>,
Andrew Lunn <andrew@...n.ch>,
Vladimir Oltean <vladimir.oltean@....com>
Subject: [RFC PATCH v2 net-next 7/9] net: pcs: xpcs: use mdiobus_c45_addr in xpcs_{read,write}
From: Vladimir Oltean <vladimir.oltean@....com>
Use the dedicated helper for abstracting away how the clause 45 address
is packed in reg_addr.
Signed-off-by: Vladimir Oltean <vladimir.oltean@....com>
---
drivers/net/pcs/pcs-xpcs.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/pcs/pcs-xpcs.c b/drivers/net/pcs/pcs-xpcs.c
index 964433849ef8..c3760192fe20 100644
--- a/drivers/net/pcs/pcs-xpcs.c
+++ b/drivers/net/pcs/pcs-xpcs.c
@@ -275,14 +275,14 @@ static bool __xpcs_linkmode_supported(const struct xpcs_compat *compat,
static int xpcs_read(struct mdio_xpcs_args *xpcs, int dev, u32 reg)
{
- u32 reg_addr = MII_ADDR_C45 | dev << 16 | reg;
+ u32 reg_addr = mdiobus_c45_addr(dev, reg);
return mdiobus_read(xpcs->bus, xpcs->addr, reg_addr);
}
static int xpcs_write(struct mdio_xpcs_args *xpcs, int dev, u32 reg, u16 val)
{
- u32 reg_addr = MII_ADDR_C45 | dev << 16 | reg;
+ u32 reg_addr = mdiobus_c45_addr(dev, reg);
return mdiobus_write(xpcs->bus, xpcs->addr, reg_addr, val);
}
--
2.25.1
Powered by blists - more mailing lists