+ strfieldcatmax(string, tmpattr->value, maxsize);
+ dbg("substitute sysfs value '%s'", tmpattr->value);
+ } else {
+ dbg("missing attribute");
+ }
+ break;
+ case '%':
+ strfieldcatmax(string, "%", maxsize);
+ pos++;
+ break;
+ case 'e':
+ next_free_number = find_free_number(udev, string);
+ if (next_free_number > 0) {
+ sprintf(temp2, "%d", next_free_number);
+ strfieldcatmax(string, temp2, maxsize);
+ }
+ break;
+ case 'P':
+ class_dev_parent = sysfs_get_classdev_parent(class_dev);
+ if (class_dev_parent != NULL) {
+ struct udevice udev_parent;
+
+ dbg("found parent '%s', get the node name", class_dev_parent->path);
+ memset(&udev_parent, 0x00, sizeof(struct udevice));
+ /* lookup the name in the udev_db with the DEVPATH of the parent */
+ strfieldcpy(udev_parent.devpath, &class_dev_parent->path[strlen(sysfs_path)]);
+ if (udev_db_get_device(&udev_parent) == 0) {
+ strfieldcatmax(string, udev_parent.name, maxsize);
+ dbg("substitute parent node name'%s'", udev_parent.name);
+ } else
+ dbg("parent not found in database");
+ }
+ break;
+ case 'N':
+ if (udev->tmp_node[0] == '\0') {
+ dbg("create temporary device node for callout");
+ snprintf(udev->tmp_node, NAME_SIZE-1, "%s/.tmp-%u-%u", udev_root, udev->major, udev->minor);
+ udev_make_node(udev, udev->tmp_node, udev->major, udev->minor, 0600, 0, 0);