summaryrefslogtreecommitdiff
path: root/udev_db.c
diff options
context:
space:
mode:
Diffstat (limited to 'udev_db.c')
-rw-r--r--udev_db.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/udev_db.c b/udev_db.c
index 0be7620ad7..b9c504430f 100644
--- a/udev_db.c
+++ b/udev_db.c
@@ -79,7 +79,7 @@ int udev_db_add_device(struct udevice *udev)
fprintf(f, "P:%s\n", udev->devpath);
fprintf(f, "N:%s\n", udev->name);
fprintf(f, "S:%s\n", udev->symlink);
- fprintf(f, "M:%u:%u\n", udev->major, udev->minor);
+ fprintf(f, "M:%u:%u\n", major(udev->devt), minor(udev->devt));
fprintf(f, "A:%u\n", udev->partitions);
fprintf(f, "R:%u\n", udev->ignore_remove);
@@ -92,6 +92,7 @@ static int parse_db_file(struct udevice *udev, const char *filename)
{
char line[NAME_SIZE];
char temp[NAME_SIZE];
+ unsigned int major, minor;
char *bufline;
char *buf;
size_t bufsize;
@@ -127,7 +128,8 @@ static int parse_db_file(struct udevice *udev, const char *filename)
count = NAME_SIZE-1;
strncpy(temp, &bufline[2], count-2);
temp[count-2] = '\0';
- sscanf(temp, "%u:%u", &udev->major, &udev->minor);
+ sscanf(temp, "%u:%u", &major, &minor);
+ udev->devt = makedev(major, minor);
break;
case 'S':
if (count > NAME_SIZE)