- memset(udev, 0x00, sizeof(struct udevice));
-
- if (devpath)
- strfieldcpy(udev->devpath, devpath);
- if (subsystem)
- strfieldcpy(udev->subsystem, subsystem);
-
- if (strcmp(udev->subsystem, "block") == 0)
- udev->type = 'b';
- else if (strcmp(udev->subsystem, "net") == 0)
- udev->type = 'n';
- else if (strncmp(udev->devpath, "/block/", 7) == 0)
- udev->type = 'b';
- else if (strncmp(udev->devpath, "/class/net/", 11) == 0)
- udev->type = 'n';
- else if (strncmp(udev->devpath, "/class/", 7) == 0)
- udev->type = 'c';
-
- udev->mode = 0660;
- strcpy(udev->owner, "root");
- strcpy(udev->group, "root");
+ char *endptr;
+ int prio;
+
+ prio = strtol(priority, &endptr, 10);
+ if (endptr[0] == '\0')
+ return prio;
+ if (strncasecmp(priority, "err", 3) == 0)
+ return LOG_ERR;
+ if (strcasecmp(priority, "info") == 0)
+ return LOG_INFO;
+ if (strcasecmp(priority, "debug") == 0)
+ return LOG_DEBUG;
+ if (string_is_true(priority))
+ return LOG_ERR;
+
+ return 0;