]> git.ipfire.org Git - thirdparty/linux.git/commit
net: stmmac: rk: simplify set_*_speed()
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Thu, 12 Jun 2025 15:40:46 +0000 (16:40 +0100)
committerJakub Kicinski <kuba@kernel.org>
Sat, 14 Jun 2025 01:22:58 +0000 (18:22 -0700)
commite6e9e837d312ee872892d9207c58763f0838a36c
treea19eb2309a431cc4ea8b2dc6e5c2489b82e75ec5
parent1f59e30403a747eb3a4e2d504018b3c4bcc3e54a
net: stmmac: rk: simplify set_*_speed()

Rather than having lots of regmap_write()s to the same register but
with different values depending on the speed, reorganise the
functions to use a local variable for the value, and then have one
regmap_write() call to write it to the register. This reduces the
amount of code and is a step towards further reducing the code size.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://patch.msgid.link/E1uPk2o-004CFH-Q4@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c