projects
/
platform
/
kernel
/
linux-starfive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8e2bb95
)
net: pcs: xpcs: use mdiobus_c45_addr in xpcs_{read,write}
author
Vladimir Oltean
<vladimir.oltean@nxp.com>
Wed, 2 Jun 2021 16:20:17 +0000
(19:20 +0300)
committer
David S. Miller
<davem@davemloft.net>
Thu, 3 Jun 2021 20:30:43 +0000
(13:30 -0700)
Use the dedicated helper for abstracting away how the clause 45 address
is packed in reg_addr.
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/pcs/pcs-xpcs.c
patch
|
blob
|
history
diff --git
a/drivers/net/pcs/pcs-xpcs.c
b/drivers/net/pcs/pcs-xpcs.c
index
7f51eb4
..
afabb92
100644
(file)
--- a/
drivers/net/pcs/pcs-xpcs.c
+++ b/
drivers/net/pcs/pcs-xpcs.c
@@
-240,14
+240,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);
}