]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: phy: realtek: Avoid PHYCR2 access if PHYCR2 not present
authorMarek Vasut <marek.vasut@mailbox.org>
Sat, 11 Oct 2025 11:02:49 +0000 (13:02 +0200)
committerJakub Kicinski <kuba@kernel.org>
Tue, 14 Oct 2025 00:46:01 +0000 (17:46 -0700)
commit2c67301584f2671e320236df6bbe75ae09feb4d0
tree2b7c59da3b13aa5ad44a6ab889eee43f91843005
parentd1d5df4691e4322656024fc374d0faec4387aa0f
net: phy: realtek: Avoid PHYCR2 access if PHYCR2 not present

The driver is currently checking for PHYCR2 register presence in
rtl8211f_config_init(), but it does so after accessing PHYCR2 to
disable EEE. This was introduced in commit bfc17c165835 ("net:
phy: realtek: disable PHY-mode EEE"). Move the PHYCR2 presence
test before the EEE disablement and simplify the code.

Fixes: bfc17c165835 ("net: phy: realtek: disable PHY-mode EEE")
Signed-off-by: Marek Vasut <marek.vasut@mailbox.org>
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://patch.msgid.link/20251011110309.12664-1-marek.vasut@mailbox.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/phy/realtek/realtek_main.c