From: Rustam Adilov <adilov@disroot.org>
To: "Linus Walleij" <linusw@kernel.org>,
"Luiz Angelo Daros de Luca" <luizluca@gmail.com>,
"Alvin Šipraga" <alvin.sipraga@analog.com>,
"Andrew Lunn" <andrew@lunn.ch>,
"Vladimir Oltean" <olteanv@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@kernel.org>,
"Jakub Kicinski" <kuba@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Heiner Kallweit" <hkallweit1@gmail.com>,
"Russell King" <linux@armlinux.org.uk>,
"Willem de Bruijn" <willemb@google.com>,
"Simon Horman" <horms@kernel.org>,
netdev@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Cc: Rustam Adilov <adilov@disroot.org>
Subject: [RFC PATCH net-next 5/6] net: phy: realtek: use mdio.addr instead of 0 in rtlgen_read/write_vend2
Date: Fri, 4 Dec 2026 23:25:19 +0500 [thread overview]
Message-ID: <20261204182553.33952-6-adilov@disroot.org> (raw)
In-Reply-To: <20261204182553.33952-1-adilov@disroot.org>
Use the proper mdio.addr in rtlgen_read_vend2 and rtlgen_write_vend2
when passing addr to c45_read/write instead of hardcoded 0. That allows
mdio bus with multiple phy addresses like RTL9607C's internal mdio bus
to work properly.
Signed-off-by: Rustam Adilov <adilov@disroot.org>
---
drivers/net/phy/realtek/realtek_main.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/net/phy/realtek/realtek_main.c b/drivers/net/phy/realtek/realtek_main.c
index a39ad18382f2..80efaaddc986 100644
--- a/drivers/net/phy/realtek/realtek_main.c
+++ b/drivers/net/phy/realtek/realtek_main.c
@@ -1757,13 +1757,14 @@ static int rtlgen_read_status(struct phy_device *phydev)
static int rtlgen_read_vend2(struct phy_device *phydev, int regnum)
{
- return __mdiobus_c45_read(phydev->mdio.bus, 0, MDIO_MMD_VEND2, regnum);
+ return __mdiobus_c45_read(phydev->mdio.bus, phydev->mdio.addr,
+ MDIO_MMD_VEND2, regnum);
}
static int rtlgen_write_vend2(struct phy_device *phydev, int regnum, u16 val)
{
- return __mdiobus_c45_write(phydev->mdio.bus, 0, MDIO_MMD_VEND2, regnum,
- val);
+ return __mdiobus_c45_write(phydev->mdio.bus, phydev->mdio.addr,
+ MDIO_MMD_VEND2, regnum, val);
}
static int rtlgen_read_mmd(struct phy_device *phydev, int devnum, u16 regnum)
--
2.56.1
next prev parent reply other threads:[~2026-12-04 18:29 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-04 18:25 [RFC PATCH net-next 0/6] net: dsa: realtek: add support for RTL9607C switch Rustam Adilov
2026-12-04 18:25 ` [RFC PATCH net-next 1/6] net: dsa: tag_rtl8_4: add support for RTL9607C tag variant Rustam Adilov
2026-12-04 18:25 ` [RFC PATCH net-next 2/6] net: dsa: realtek: add new mmio interface for drivers Rustam Adilov
2026-12-04 18:25 ` [RFC PATCH net-next 3/6] dt-bindings: net: dsa: realtek: add new rtl9607c switch compatible Rustam Adilov
2026-12-04 18:25 ` [RFC PATCH net-next 4/6] net: dsa: realtek: add support for RTL9607C switch Rustam Adilov
2026-12-04 18:25 ` Rustam Adilov [this message]
2026-12-04 18:25 ` [RFC PATCH net-next 6/6] net: phy: realtek: add support for RTL9607C internal PHYs Rustam Adilov
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=20261204182553.33952-6-adilov@disroot.org \
--to=adilov@disroot.org \
--cc=alvin.sipraga@analog.com \
--cc=andrew@lunn.ch \
--cc=conor+dt@kernel.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@kernel.org \
--cc=hkallweit1@gmail.com \
--cc=horms@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=linusw@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=luizluca@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
--cc=robh@kernel.org \
--cc=willemb@google.com \
/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