feat: standard vga support (mode switching, framebuffer remapping)
[lunaix-os.git] / lunaix-os / hal / rng / rngx86.c
index f398c662a0cb87c13666ec29ae872d34cf058098..3035f314dc6b238ca3f56afc0c20d791667845ae 100644 (file)
@@ -31,16 +31,18 @@ __rand_rd(struct device* dev, void* buf, size_t offset, size_t len)
 int
 pdev_randdev_init(struct device_def* devdef)
 {
-    struct device* devrand = device_addseq(NULL, &devdef->class, NULL, "rand");
+    struct device* devrand = device_allocseq(NULL, NULL);
     devrand->ops.read = __rand_rd;
     devrand->ops.read_page = __rand_rd_pg;
 
+    device_register(devrand, &devdef->class, "rand");
+
     return 0;
 }
 
 static struct device_def devrandx86_def = {
     .name = "x86 On-Chip RNG",
-    .class = DEVCLASS(DEVIF_SOC, DEVFN_CHAR, DEV_RNG, 0),
+    .class = DEVCLASS(DEVIF_SOC, DEVFN_CHAR, DEV_RNG),
     .init = pdev_randdev_init
 };
 EXPORT_DEVICE(randdev, &devrandx86_def, load_earlystage);
\ No newline at end of file