{
        enum devlink_port_flavour flavour;
        struct dsa_switch *ds = dp->ds;
+       struct dsa_switch_tree *dst = ds->dst;
        int err;
 
        if (dp->type == DSA_PORT_TYPE_UNUSED)
         * independent from front panel port numbers.
         */
        devlink_port_attrs_set(&dp->devlink_port, flavour,
-                              dp->index, false, 0, NULL, 0);
+                              dp->index, false, 0,
+                              (const char *) &dst->index, sizeof(dst->index));
        err = devlink_port_register(ds->devlink, &dp->devlink_port,
                                    dp->index);
        if (err)
 
        struct dsa_switch *ds = dp->ds;
        struct dsa_switch_tree *dst = ds->dst;
 
+       /* For non-legacy ports, devlink is used and it takes
+        * care of the name generation. This ndo implementation
+        * should be removed with legacy support.
+        */
+       if (dp->ds->devlink)
+               return -EOPNOTSUPP;
+
        ppid->id_len = sizeof(dst->index);
        memcpy(&ppid->id, &dst->index, ppid->id_len);