Merge branch '2022-01-08-further-important-updates'
[platform/kernel/u-boot.git] / common / iomux.c
index b9088aa..c428f71 100644 (file)
@@ -158,8 +158,12 @@ int iomux_replace_device(const int console, const char *old, const char *new)
                        return -ENOMEM;
                }
 
-               strcat(tmp, ",");
-               strcat(tmp, name);
+               if (arg) {
+                       strcat(tmp, ",");
+                       strcat(tmp, name);
+               }
+               else
+                       strcpy(tmp, name);
 
                arg = tmp;
                size = strlen(tmp) + 1;