]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
net: phy: remove phy_attach
authorHeiner Kallweit <hkallweit1@gmail.com>
Wed, 4 Mar 2026 20:17:28 +0000 (21:17 +0100)
committerJakub Kicinski <kuba@kernel.org>
Sat, 7 Mar 2026 00:47:56 +0000 (16:47 -0800)
378e6523ebb1 ("net: bcmgenet: remove unused platform code") removed
the last user of phy_attach(). So remove this function.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Link: https://patch.msgid.link/8812176a-e319-4e9f-815d-99ea339df8b2@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/phy/phy_device.c
include/linux/phy.h

index 3bd415710bf3f8261c5b2afa2c93079542e8efaf..d1cbcfc3d2a66a28904a53b2b00fcb2e5b920c98 100644 (file)
@@ -1895,44 +1895,6 @@ error_put_device:
 }
 EXPORT_SYMBOL(phy_attach_direct);
 
-/**
- * phy_attach - attach a network device to a particular PHY device
- * @dev: network device to attach
- * @bus_id: Bus ID of PHY device to attach
- * @interface: PHY device's interface
- *
- * Description: Same as phy_attach_direct() except that a PHY bus_id
- *     string is passed instead of a pointer to a struct phy_device.
- */
-struct phy_device *phy_attach(struct net_device *dev, const char *bus_id,
-                             phy_interface_t interface)
-{
-       struct phy_device *phydev;
-       struct device *d;
-       int rc;
-
-       if (!dev)
-               return ERR_PTR(-EINVAL);
-
-       /* Search the list of PHY devices on the mdio bus for the
-        * PHY with the requested name
-        */
-       d = bus_find_device_by_name(&mdio_bus_type, NULL, bus_id);
-       if (!d) {
-               pr_err("PHY %s not found\n", bus_id);
-               return ERR_PTR(-ENODEV);
-       }
-       phydev = to_phy_device(d);
-
-       rc = phy_attach_direct(dev, phydev, phydev->dev_flags, interface);
-       put_device(d);
-       if (rc)
-               return ERR_PTR(rc);
-
-       return phydev;
-}
-EXPORT_SYMBOL(phy_attach);
-
 /**
  * phy_detach - detach a PHY device from its network device
  * @phydev: target phy_device struct
index 6f9979a26892d19caba5d383ff66a7e78fc8374b..e9b0d7427b0ef3e93e361bf11799f88520f1fa94 100644 (file)
@@ -2152,8 +2152,6 @@ int phy_suspend(struct phy_device *phydev);
 int phy_resume(struct phy_device *phydev);
 int __phy_resume(struct phy_device *phydev);
 int phy_loopback(struct phy_device *phydev, bool enable, int speed);
-struct phy_device *phy_attach(struct net_device *dev, const char *bus_id,
-                             phy_interface_t interface);
 struct phy_device *phy_find_next(struct mii_bus *bus, struct phy_device *pos);
 int phy_attach_direct(struct net_device *dev, struct phy_device *phydev,
                      u32 flags, phy_interface_t interface);