]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
bus: fsl-mc: extend fsl_mc_get_endpoint() to pass interface ID
authorIoana Ciornei <ioana.ciornei@nxp.com>
Tue, 3 Aug 2021 16:57:42 +0000 (19:57 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 4 Aug 2021 08:53:34 +0000 (09:53 +0100)
In case of a switch DPAA2 object, the interface ID is also needed when
querying for the object endpoint. Extend fsl_mc_get_endpoint() so that
users can also pass the interface ID that are interested in.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/bus/fsl-mc/fsl-mc-bus.c
drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
include/linux/fsl/mc.h

index 09c8ab5e0959e3d75d6b0358c2ef0aec7c62996d..b3691de8ac06e7cad3ac74db9e91dccfced518c6 100644 (file)
@@ -914,7 +914,8 @@ void fsl_mc_device_remove(struct fsl_mc_device *mc_dev)
 }
 EXPORT_SYMBOL_GPL(fsl_mc_device_remove);
 
-struct fsl_mc_device *fsl_mc_get_endpoint(struct fsl_mc_device *mc_dev)
+struct fsl_mc_device *fsl_mc_get_endpoint(struct fsl_mc_device *mc_dev,
+                                         u16 if_id)
 {
        struct fsl_mc_device *mc_bus_dev, *endpoint;
        struct fsl_mc_obj_desc endpoint_desc = {{ 0 }};
@@ -925,6 +926,7 @@ struct fsl_mc_device *fsl_mc_get_endpoint(struct fsl_mc_device *mc_dev)
        mc_bus_dev = to_fsl_mc_device(mc_dev->dev.parent);
        strcpy(endpoint1.type, mc_dev->obj_desc.type);
        endpoint1.id = mc_dev->obj_desc.id;
+       endpoint1.if_id = if_id;
 
        err = dprc_get_connection(mc_bus_dev->mc_io, 0,
                                  mc_bus_dev->mc_handle,
index f664021c3ad183fd1cde5cc3d41d465d85bb5138..7065c71ed7b86ec856014fa1157c37adff745ea1 100644 (file)
@@ -4138,7 +4138,7 @@ static int dpaa2_eth_connect_mac(struct dpaa2_eth_priv *priv)
        int err;
 
        dpni_dev = to_fsl_mc_device(priv->net_dev->dev.parent);
-       dpmac_dev = fsl_mc_get_endpoint(dpni_dev);
+       dpmac_dev = fsl_mc_get_endpoint(dpni_dev, 0);
 
        if (PTR_ERR(dpmac_dev) == -EPROBE_DEFER)
                return PTR_ERR(dpmac_dev);
index 63b56aba925aec729447474dcb8015dc78d14e9a..30ece3ae6df7b734624ac37d5bf78474d112c024 100644 (file)
@@ -423,7 +423,8 @@ int __must_check fsl_mc_allocate_irqs(struct fsl_mc_device *mc_dev);
 
 void fsl_mc_free_irqs(struct fsl_mc_device *mc_dev);
 
-struct fsl_mc_device *fsl_mc_get_endpoint(struct fsl_mc_device *mc_dev);
+struct fsl_mc_device *fsl_mc_get_endpoint(struct fsl_mc_device *mc_dev,
+                                         u16 if_id);
 
 extern struct bus_type fsl_mc_bus_type;