]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: stmmac: consolidate version reading and validation
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Wed, 29 Oct 2025 00:03:20 +0000 (00:03 +0000)
committerJakub Kicinski <kuba@kernel.org>
Thu, 30 Oct 2025 00:18:22 +0000 (17:18 -0700)
commitc36b97e4ca773f20ff20db34ed97e35cc36ad97c
tree4e650a081d12e66789be53f8867e3b7a72d44286
parentf49838f77cf6c50961afa33a5bc1ea95e061d7f0
net: stmmac: consolidate version reading and validation

There is no need to read the version register twice, once in
stmmac_get_id() and then again in stmmac_get_dev_id(). Consolidate
this into stmmac_get_version() and pass each of these this value.

As both functions unnecessarily issue the same warning for a zero
register value, also move this into stmmac_get_version().

Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Tested-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Tested-by: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://patch.msgid.link/E1vDteq-0000000CCC3-3zbJ@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/hwif.c