+ case 'P':
+ if (!class_dev)
+ break;
+ 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);
+ udev_init_device(&udev_parent, NULL, NULL);
+ /* lookup the name in the udev_db with the DEVPATH of the parent */
+ if (udev_db_get_device(&udev_parent, &class_dev_parent->path[strlen(sysfs_path)]) == 0) {
+ strlcat(string, udev_parent.name, maxsize);
+ dbg("substitute parent node name'%s'", udev_parent.name);
+ } else
+ dbg("parent not found in database");
+ udev_cleanup_device(&udev_parent);
+ }
+ break;
+ case 'N':
+ if (udev->tmp_node[0] == '\0') {
+ dbg("create temporary device node for callout");
+ snprintf(udev->tmp_node, sizeof(udev->tmp_node), "%s/.tmp-%u-%u",
+ udev_root, major(udev->devt), minor(udev->devt));
+ udev->tmp_node[sizeof(udev->tmp_node)-1] = '\0';
+ udev_make_node(udev, udev->tmp_node, udev->devt, 0600, 0, 0);
+ }
+ strlcat(string, udev->tmp_node, maxsize);
+ dbg("substitute temporary device node name '%s'", udev->tmp_node);
+ break;
+ case 'r':
+ strlcat(string, udev_root, maxsize);
+ dbg("substitute udev_root '%s'", udev_root);
+ break;