Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: mdio: Remove of_phy_attach()

We have no in-tree users, also update the sfp-phylink.rst documentation
to indicate that phy_attach_direct() is used instead of of_phy_attach().

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Florian Fainelli and committed by
David S. Miller
96313e1d 59756555

+1 -41
+1 -1
Documentation/networking/sfp-phylink.rst
··· 163 163 err = phylink_of_phy_connect(priv->phylink, node, flags); 164 164 165 165 For the most part, ``flags`` can be zero; these flags are passed to 166 - the of_phy_attach() inside this function call if a PHY is specified 166 + the phy_attach_direct() inside this function call if a PHY is specified 167 167 in the DT node ``node``. 168 168 169 169 ``node`` should be the DT node which contains the network phy property,
-30
drivers/net/mdio/of_mdio.c
··· 462 462 } 463 463 EXPORT_SYMBOL(of_phy_get_and_connect); 464 464 465 - /** 466 - * of_phy_attach - Attach to a PHY without starting the state machine 467 - * @dev: pointer to net_device claiming the phy 468 - * @phy_np: Node pointer for the PHY 469 - * @flags: flags to pass to the PHY 470 - * @iface: PHY data interface type 471 - * 472 - * If successful, returns a pointer to the phy_device with the embedded 473 - * struct device refcount incremented by one, or NULL on failure. The 474 - * refcount must be dropped by calling phy_disconnect() or phy_detach(). 475 - */ 476 - struct phy_device *of_phy_attach(struct net_device *dev, 477 - struct device_node *phy_np, u32 flags, 478 - phy_interface_t iface) 479 - { 480 - struct phy_device *phy = of_phy_find_device(phy_np); 481 - int ret; 482 - 483 - if (!phy) 484 - return NULL; 485 - 486 - ret = phy_attach_direct(dev, phy, flags, iface); 487 - 488 - /* refcount is held by phy_attach_direct() on success */ 489 - put_device(&phy->mdio.dev); 490 - 491 - return ret ? NULL : phy; 492 - } 493 - EXPORT_SYMBOL(of_phy_attach); 494 - 495 465 /* 496 466 * of_phy_is_fixed_link() and of_phy_register_fixed_link() must 497 467 * support two DT bindings:
-10
include/linux/of_mdio.h
··· 26 26 struct phy_device * 27 27 of_phy_get_and_connect(struct net_device *dev, struct device_node *np, 28 28 void (*hndlr)(struct net_device *)); 29 - struct phy_device * 30 - of_phy_attach(struct net_device *dev, struct device_node *phy_np, 31 - u32 flags, phy_interface_t iface); 32 29 33 30 struct mii_bus *of_mdio_find_bus(struct device_node *mdio_np); 34 31 int of_phy_register_fixed_link(struct device_node *np); ··· 93 96 static inline struct phy_device * 94 97 of_phy_get_and_connect(struct net_device *dev, struct device_node *np, 95 98 void (*hndlr)(struct net_device *)) 96 - { 97 - return NULL; 98 - } 99 - 100 - static inline struct phy_device *of_phy_attach(struct net_device *dev, 101 - struct device_node *phy_np, 102 - u32 flags, phy_interface_t iface) 103 99 { 104 100 return NULL; 105 101 }