bnxt: set devlink port type after registration
authorJiri Pirko <jiri@mellanox.com>
Sun, 24 Mar 2019 10:14:35 +0000 (11:14 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sun, 24 Mar 2019 18:55:31 +0000 (14:55 -0400)
Move the type set of devlink port after it is registered.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c

index a266bff559dc66f6038ee979cbca1d35b900e7ad..ab6fd05c462bd975e0e0e38c5c7f0408d46eb277 100644 (file)
@@ -229,7 +229,6 @@ int bnxt_dl_register(struct bnxt *bp)
                goto err_dl_unreg;
        }
 
-       devlink_port_type_eth_set(&bp->dl_port, bp->dev);
        devlink_port_attrs_set(&bp->dl_port, DEVLINK_PORT_FLAVOUR_PHYSICAL,
                               bp->pf.port_id, false, 0);
        rc = devlink_port_register(dl, &bp->dl_port, bp->pf.port_id);
@@ -237,6 +236,7 @@ int bnxt_dl_register(struct bnxt *bp)
                netdev_err(bp->dev, "devlink_port_register failed");
                goto err_dl_param_unreg;
        }
+       devlink_port_type_eth_set(&bp->dl_port, bp->dev);
 
        rc = devlink_port_params_register(&bp->dl_port, bnxt_dl_port_params,
                                          ARRAY_SIZE(bnxt_dl_port_params));