]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
net: pcs: xpcs: drop interface argument from xpcs_create*()
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Tue, 1 Oct 2024 16:04:51 +0000 (17:04 +0100)
committerJakub Kicinski <kuba@kernel.org>
Thu, 3 Oct 2024 00:32:01 +0000 (17:32 -0700)
The XPCS sub-driver no longer uses the "interface" argument to the
xpcs_create_mdiodev() and xpcs_create_fwnode() functions. Remove
this now unnecessary argument, updating the stmmac driver
appropriately.

Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://patch.msgid.link/E1svfMp-005ZIp-UX@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
drivers/net/pcs/pcs-xpcs.c
include/linux/pcs/pcs-xpcs.h

index 03f90676b3ad8c7d71f218efe51658756e44de46..0c7d81ddd4406d28dfc47cb87ff507e5c0bd54ce 100644 (file)
@@ -500,23 +500,22 @@ int stmmac_pcs_setup(struct net_device *ndev)
        struct fwnode_handle *devnode, *pcsnode;
        struct dw_xpcs *xpcs = NULL;
        struct stmmac_priv *priv;
-       int addr, mode, ret;
+       int addr, ret;
 
        priv = netdev_priv(ndev);
-       mode = priv->plat->phy_interface;
        devnode = priv->plat->port_node;
 
        if (priv->plat->pcs_init) {
                ret = priv->plat->pcs_init(priv);
        } else if (fwnode_property_present(devnode, "pcs-handle")) {
                pcsnode = fwnode_find_reference(devnode, "pcs-handle", 0);
-               xpcs = xpcs_create_fwnode(pcsnode, mode);
+               xpcs = xpcs_create_fwnode(pcsnode);
                fwnode_handle_put(pcsnode);
                ret = PTR_ERR_OR_ZERO(xpcs);
        } else if (priv->plat->mdio_bus_data &&
                   priv->plat->mdio_bus_data->pcs_mask) {
                addr = ffs(priv->plat->mdio_bus_data->pcs_mask) - 1;
-               xpcs = xpcs_create_mdiodev(priv->mii, addr, mode);
+               xpcs = xpcs_create_mdiodev(priv->mii, addr);
                ret = PTR_ERR_OR_ZERO(xpcs);
        } else {
                return 0;
index 9b61f97222b96639a03c3b5ae82c7851955b2b5b..f25e7afdfdf50c55fa036b58145f437d306cdde7 100644 (file)
@@ -1520,14 +1520,12 @@ out_free_data:
  * xpcs_create_mdiodev() - create a DW xPCS instance with the MDIO @addr
  * @bus: pointer to the MDIO-bus descriptor for the device to be looked at
  * @addr: device MDIO-bus ID
- * @interface: requested PHY interface
  *
  * Return: a pointer to the DW XPCS handle if successful, otherwise -ENODEV if
  * the PCS device couldn't be found on the bus and other negative errno related
  * to the data allocation and MDIO-bus communications.
  */
-struct dw_xpcs *xpcs_create_mdiodev(struct mii_bus *bus, int addr,
-                                   phy_interface_t interface)
+struct dw_xpcs *xpcs_create_mdiodev(struct mii_bus *bus, int addr)
 {
        struct mdio_device *mdiodev;
        struct dw_xpcs *xpcs;
@@ -1554,7 +1552,7 @@ struct phylink_pcs *xpcs_create_pcs_mdiodev(struct mii_bus *bus, int addr)
 {
        struct dw_xpcs *xpcs;
 
-       xpcs = xpcs_create_mdiodev(bus, addr, PHY_INTERFACE_MODE_NA);
+       xpcs = xpcs_create_mdiodev(bus, addr);
        if (IS_ERR(xpcs))
                return ERR_CAST(xpcs);
 
@@ -1565,7 +1563,6 @@ EXPORT_SYMBOL_GPL(xpcs_create_pcs_mdiodev);
 /**
  * xpcs_create_fwnode() - Create a DW xPCS instance from @fwnode
  * @fwnode: fwnode handle poining to the DW XPCS device
- * @interface: requested PHY interface
  *
  * Return: a pointer to the DW XPCS handle if successful, otherwise -ENODEV if
  * the fwnode device is unavailable or the PCS device couldn't be found on the
@@ -1573,8 +1570,7 @@ EXPORT_SYMBOL_GPL(xpcs_create_pcs_mdiodev);
  * other negative errno related to the data allocations and MDIO-bus
  * communications.
  */
-struct dw_xpcs *xpcs_create_fwnode(struct fwnode_handle *fwnode,
-                                  phy_interface_t interface)
+struct dw_xpcs *xpcs_create_fwnode(struct fwnode_handle *fwnode)
 {
        struct mdio_device *mdiodev;
        struct dw_xpcs *xpcs;
index a4e2243ce6474252f9df666a48b6a586166945e2..758daabb76c7c20cdb1d016c2353dfdedc3ffb70 100644 (file)
@@ -72,10 +72,8 @@ int xpcs_do_config(struct dw_xpcs *xpcs, phy_interface_t interface,
 void xpcs_get_interfaces(struct dw_xpcs *xpcs, unsigned long *interfaces);
 int xpcs_config_eee(struct dw_xpcs *xpcs, int mult_fact_100ns,
                    int enable);
-struct dw_xpcs *xpcs_create_mdiodev(struct mii_bus *bus, int addr,
-                                   phy_interface_t interface);
-struct dw_xpcs *xpcs_create_fwnode(struct fwnode_handle *fwnode,
-                                  phy_interface_t interface);
+struct dw_xpcs *xpcs_create_mdiodev(struct mii_bus *bus, int addr);
+struct dw_xpcs *xpcs_create_fwnode(struct fwnode_handle *fwnode);
 void xpcs_destroy(struct dw_xpcs *xpcs);
 
 struct phylink_pcs *xpcs_create_pcs_mdiodev(struct mii_bus *bus, int addr);