]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - init/do_mounts.c
Merge branch 'kbuild/kconfig' into kbuild/for-next
[karo-tx-linux.git] / init / do_mounts.c
index 8369ffa5f33db24a12703ce74eb7ac437ada96f9..dea5de95c2dd23771f44e58ada2d9b1dbfa1c5df 100644 (file)
@@ -225,10 +225,11 @@ dev_t name_to_dev_t(const char *name)
 #endif
 
        if (strncmp(name, "/dev/", 5) != 0) {
-               unsigned maj, min;
+               unsigned maj, min, offset;
                char dummy;
 
-               if (sscanf(name, "%u:%u%c", &maj, &min, &dummy) == 2) {
+               if ((sscanf(name, "%u:%u%c", &maj, &min, &dummy) == 2) ||
+                   (sscanf(name, "%u:%u:%u:%c", &maj, &min, &offset, &dummy) == 3)) {
                        res = MKDEV(maj, min);
                        if (maj != MAJOR(res) || min != MINOR(res))
                                goto fail;
@@ -532,8 +533,13 @@ void __init mount_root(void)
        }
 #endif
 #ifdef CONFIG_BLOCK
-       create_dev("/dev/root", ROOT_DEV);
-       mount_block_root("/dev/root", root_mountflags);
+       {
+               int err = create_dev("/dev/root", ROOT_DEV);
+
+               if (err < 0)
+                       pr_emerg("Failed to create /dev/root: %d\n", err);
+               mount_block_root("/dev/root", root_mountflags);
+       }
 #endif
 }