makedevs: Correct the device number calculation for blocks of devices
authorPeter Kjellerstedt <pkj@axis.com>
Wed, 29 May 2013 11:51:02 +0000 (11:51 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 30 May 2013 19:59:12 +0000 (20:59 +0100)
If the increment > 1 and the start > 0 then the calculation for the
minor device number was incorrect.

(From OE-Core rev: 0a878426bee607a7d961ba475a7ec7e89115df35)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-devtools/makedevs/makedevs-1.0.0/makedevs.c

index 247d6c1..d58e891 100644 (file)
@@ -226,7 +226,7 @@ static int interpret_table_entry(char *line)
                                sprintf(path, "%s/%s%d", rootdir, name, i);
                                /* FIXME:  MKDEV uses illicit insider knowledge of kernel 
                                 * major/minor representation...  */
-                               rdev = MKDEV(major, minor + (i * increment - start));
+                               rdev = MKDEV(major, minor + (i - start) * increment);
                                add_new_device(buf, path, uid, gid, mode, rdev);
                        }
                } else {