mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-30 05:19:04 -04:00
net: ethernet: oa_tc6: Use the read_mms/write_mms functions for C45
Accessing PHY MMD devices requires control transactions to registers in
a memory map other than 0. Replace the current formatting of the
register addresses with the oa_tc6_{read,write}_register_mms()
functions. While we're here, introduce the mms variable to store the
memory map returned by oa_tc6_get_phy_c45_mms() instead of ret, in order
to improve the code readability.
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Ciprian Regus <ciprian.regus@analog.com>
Link: https://patch.msgid.link/20260708-adin1140-driver-v5-8-4aca7b51a58b@analog.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
committed by
Paolo Abeni
parent
6ad2501794
commit
92ec8d69dd
@@ -499,13 +499,14 @@ int oa_tc6_mdiobus_read_c45(struct mii_bus *bus, int addr, int devnum,
|
||||
{
|
||||
struct oa_tc6 *tc6 = bus->priv;
|
||||
u32 regval;
|
||||
int mms;
|
||||
int ret;
|
||||
|
||||
ret = oa_tc6_get_phy_c45_mms(devnum);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
mms = oa_tc6_get_phy_c45_mms(devnum);
|
||||
if (mms < 0)
|
||||
return mms;
|
||||
|
||||
ret = oa_tc6_read_register(tc6, (ret << 16) | regnum, ®val);
|
||||
ret = oa_tc6_read_register_mms(tc6, mms, regnum, ®val);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
@@ -517,13 +518,13 @@ int oa_tc6_mdiobus_write_c45(struct mii_bus *bus, int addr, int devnum,
|
||||
int regnum, u16 val)
|
||||
{
|
||||
struct oa_tc6 *tc6 = bus->priv;
|
||||
int ret;
|
||||
int mms;
|
||||
|
||||
ret = oa_tc6_get_phy_c45_mms(devnum);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
mms = oa_tc6_get_phy_c45_mms(devnum);
|
||||
if (mms < 0)
|
||||
return mms;
|
||||
|
||||
return oa_tc6_write_register(tc6, (ret << 16) | regnum, val);
|
||||
return oa_tc6_write_register_mms(tc6, mms, regnum, val);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(oa_tc6_mdiobus_write_c45);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user