+ size_t strlen =
+ ksnprintfv(dev->name_val, fmt, DEVICE_NAME_SIZE, args);
+
+ dev->name = HSTR(dev->name_val, strlen);
+
+ hstr_rehash(&dev->name, HSTR_FULL_HASH);
+}
+
+void
+device_register(struct device* dev, struct devclass* class, char* fmt, ...)
+{
+ va_list args;
+ va_start(args, fmt);
+
+ if (fmt) {
+ device_setname_vargs(dev, fmt, args);
+ }
+
+ if (class) {
+ dev->ident = (struct devident){ .fn_grp = class->fn_grp,
+ .unique = DEV_UNIQUE(class->device,
+ class->variant) };
+ }
+
+ dev->dev_uid = devid++;