[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0e2a50d9-ee7c-4c15-8c31-a42fff1522e6@gmail.com>
Date: Thu, 3 Apr 2025 11:37:58 -0700
From: Florian Fainelli <f.fainelli@...il.com>
To: Sean Anderson <sean.anderson@...ux.dev>, netdev@...r.kernel.org,
Andrew Lunn <andrew+netdev@...n.ch>, "David S . Miller"
<davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Russell King <linux@...linux.org.uk>
Cc: linux-kernel@...r.kernel.org, Christian Marangi <ansuelsmth@...il.com>,
upstream@...oha.com, Heiner Kallweit <hkallweit1@...il.com>
Subject: Re: [RFC net-next PATCH 06/13] net: phy: Export some functions
On 4/3/25 11:19, Sean Anderson wrote:
> Export a few functions so they can be used outside the phy subsystem:
>
> get_phy_c22_id is useful when probing MDIO devices which present a
> phy-like interface despite not using the Linux ethernet phy subsystem.
>
> mdio_device_bus_match is useful when creating MDIO devices manually
> (e.g. on non-devicetree platforms).
>
> Signed-off-by: Sean Anderson <sean.anderson@...ux.dev>
> ---
>
> drivers/net/phy/mdio_device.c | 1 +
> drivers/net/phy/phy_device.c | 3 ++-
> include/linux/phy.h | 1 +
> 3 files changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/phy/mdio_device.c b/drivers/net/phy/mdio_device.c
> index e747ee63c665..cce3f405d1a4 100644
> --- a/drivers/net/phy/mdio_device.c
> +++ b/drivers/net/phy/mdio_device.c
> @@ -45,6 +45,7 @@ int mdio_device_bus_match(struct device *dev, const struct device_driver *drv)
>
> return strcmp(mdiodev->modalias, drv->name) == 0;
> }
> +EXPORT_SYMBOL_GPL(mdio_device_bus_match);
>
> struct mdio_device *mdio_device_create(struct mii_bus *bus, int addr)
> {
> diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
> index 675fbd225378..45d8bc13eb64 100644
> --- a/drivers/net/phy/phy_device.c
> +++ b/drivers/net/phy/phy_device.c
> @@ -859,7 +859,7 @@ static int get_phy_c45_ids(struct mii_bus *bus, int addr,
> * valid, %-EIO on bus access error, or %-ENODEV if no device responds
> * or invalid ID.
> */
> -static int get_phy_c22_id(struct mii_bus *bus, int addr, u32 *phy_id)
> +int get_phy_c22_id(struct mii_bus *bus, int addr, u32 *phy_id)
> {
> int phy_reg;
>
> @@ -887,6 +887,7 @@ static int get_phy_c22_id(struct mii_bus *bus, int addr, u32 *phy_id)
>
> return 0;
> }
> +EXPORT_SYMBOL_GPL(get_phy_c22_id);
>
> /* Extract the phy ID from the compatible string of the form
> * ethernet-phy-idAAAA.BBBB.
> diff --git a/include/linux/phy.h b/include/linux/phy.h
> index a2bfae80c449..c648f1699c5c 100644
> --- a/include/linux/phy.h
> +++ b/include/linux/phy.h
> @@ -1754,6 +1754,7 @@ struct phy_device *phy_device_create(struct mii_bus *bus, int addr, u32 phy_id,
> bool is_c45,
> struct phy_c45_device_ids *c45_ids);
> #if IS_ENABLED(CONFIG_PHYLIB)
> +int get_phy_c22_id(struct mii_bus *bus, int addr, u32 *phy_id);
Seems like you will need to provide an empty inline stub for when
CONFIG_PHYLIB=n?
--
Florian
Powered by blists - more mailing lists