+static void nodemgr_register_device(struct node_entry *ne,
+ struct unit_directory *ud, struct device *parent)
+{
+ memcpy(&ud->device, &nodemgr_dev_template_ud,
+ sizeof(ud->device));
+
+ ud->device.parent = parent;
+
+ snprintf(ud->device.bus_id, BUS_ID_SIZE, "%s-%u",
+ ne->device.bus_id, ud->id);
+
+ ud->class_dev.dev = &ud->device;
+ ud->class_dev.class = &nodemgr_ud_class;
+ snprintf(ud->class_dev.class_id, BUS_ID_SIZE, "%s-%u",
+ ne->device.bus_id, ud->id);
+
+ device_register(&ud->device);
+ class_device_register(&ud->class_dev);
+ get_device(&ud->device);
+
+ if (ud->vendor_oui)
+ device_create_file(&ud->device, &dev_attr_ud_vendor_oui);
+ nodemgr_create_ud_dev_files(ud);
+}
+