]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
net: phy: add phy_interface_copy()
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Tue, 16 Sep 2025 21:46:36 +0000 (22:46 +0100)
committerJakub Kicinski <kuba@kernel.org>
Mon, 22 Sep 2025 23:05:14 +0000 (16:05 -0700)
Add a helper for copying PHY interface bitmasks. This will be used by
the SFP bus code, which will then be moved to phylink in the subsequent
patches.

Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://patch.msgid.link/E1uydVU-000000061W8-2IDT@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/linux/phy.h

index 7da9e19471c93d0b0c12be6b2d76ee045010ee6f..d09fc42e61f32fe58d6442ad6677cae4028f9e0c 100644 (file)
@@ -169,6 +169,11 @@ static inline bool phy_interface_empty(const unsigned long *intf)
        return bitmap_empty(intf, PHY_INTERFACE_MODE_MAX);
 }
 
+static inline void phy_interface_copy(unsigned long *d, const unsigned long *s)
+{
+       bitmap_copy(d, s, PHY_INTERFACE_MODE_MAX);
+}
+
 static inline unsigned int phy_interface_weight(const unsigned long *intf)
 {
        return bitmap_weight(intf, PHY_INTERFACE_MODE_MAX);