+ /* Check if starting part if either of 'fslmc:' or 'name=', separator
+ * exists.
+ */
+ if (sep_exists) {
+ /* If either of "fslmc" or "name" are starting part */
+ if (!strncmp(name, RTE_STR(FSLMC_BUS_NAME),
+ strlen(RTE_STR(FSLMC_BUS_NAME))) ||
+ (!strncmp(name, "name", strlen("name")))) {
+ goto jump_out;
+ } else {
+ DPAA2_BUS_DEBUG("Invalid device for matching (%s).",
+ name);
+ ret = -EINVAL;
+ goto err_out;
+ }
+ } else
+ sep = name;
+
+jump_out:
+ /* Validate device name */
+ if (strncmp("dpni", sep, 4) &&
+ strncmp("dpseci", sep, 6) &&
+ strncmp("dpcon", sep, 5) &&
+ strncmp("dpbp", sep, 4) &&
+ strncmp("dpio", sep, 4) &&
+ strncmp("dpci", sep, 4) &&
+ strncmp("dpmcp", sep, 5) &&
+ strncmp("dpdmai", sep, 6) &&
+ strncmp("dpdmux", sep, 6)) {
+ DPAA2_BUS_DEBUG("Unknown or unsupported device (%s)", sep);
+ ret = -EINVAL;