summaryrefslogtreecommitdiff
path: root/drivers/net/phy/phy.c
diff options
context:
space:
mode:
authorMaxime Chevallier <maxime.chevallier@bootlin.com>2025-03-07 18:36:02 +0100
committerPaolo Abeni <pabeni@redhat.com>2025-03-18 09:03:11 +0100
commit87b22ce312350170af5e970c5abfb2bb87e39964 (patch)
treefaab5b91ee30e4fdf0d154448a622d08b4ef8600 /drivers/net/phy/phy.c
parent4823ed0609194e164bcacac04a610dd86717689f (diff)
downloadlinux-next-87b22ce312350170af5e970c5abfb2bb87e39964.tar.gz
linux-next-87b22ce312350170af5e970c5abfb2bb87e39964.zip
net: phy: phy_caps: Introduce phy_caps_valid
With the link_capabilities array, it's trivial to validate a given mask againts a <speed, duplex> tuple. Create a helper for that purpose, and use it to replace a phy_settings lookup in phy_check_valid(); Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com> Link: https://patch.msgid.link/20250307173611.129125-6-maxime.chevallier@bootlin.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'drivers/net/phy/phy.c')
-rw-r--r--drivers/net/phy/phy.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 3128df03feda..8df37d221fba 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -260,7 +260,7 @@ unsigned int phy_supported_speeds(struct phy_device *phy,
*/
bool phy_check_valid(int speed, int duplex, unsigned long *features)
{
- return !!phy_lookup_setting(speed, duplex, features, true);
+ return phy_caps_valid(speed, duplex, features);
}
EXPORT_SYMBOL(phy_check_valid);