net: phy: introduce genphy_match_phy_device()
authorChristian Marangi <ansuelsmth@gmail.com>
Sat, 17 May 2025 20:13:48 +0000 (22:13 +0200)
committerJakub Kicinski <kuba@kernel.org>
Wed, 21 May 2025 22:56:10 +0000 (15:56 -0700)
commitd6c45707ac84c2d9f274ece1cea4dddb97996bde
treef28f08de6c65edd47eab17da87349c6504d8185e
parent1b76b2497aba90ce77a83b0af5943480fec5823f
net: phy: introduce genphy_match_phy_device()

Introduce new API, genphy_match_phy_device(), to provide a way to check
to match a PHY driver for a PHY device based on the info stored in the
PHY device struct.

The function generalize the logic used in phy_bus_match() to check the
PHY ID whether if C45 or C22 ID should be used for matching.

This is useful for custom .match_phy_device function that wants to use
the generic logic under some condition. (example a PHY is already setup
and provide the correct PHY ID)

Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Link: https://patch.msgid.link/20250517201353.5137-5-ansuelsmth@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/phy/phy_device.c
include/linux/phy.h