feat: standard vga support (mode switching, framebuffer remapping)
[lunaix-os.git] / lunaix-os / hal / timer / hwtimer.c
index 4da156895fb3de77384edb9e0ac5dc5a75f058e5..91dca07459d8e9caf450ecbaab8c9cddd78d8f6d 100644 (file)
@@ -58,8 +58,9 @@ hwtimer_init(u32_t hertz, void* tick_callback)
 
     current_timer = hwt_ctx;
 
-    struct device* timerdev =
-      device_addsys(NULL, &hwt_ctx->class, hwt_ctx, hwt_ctx->name);
+    struct device* timerdev = device_allocsys(NULL, hwt_ctx);
 
     timerdev->ops.exec_cmd = __hwtimer_ioctl;
+
+    device_register(timerdev, &hwt_ctx->class, hwt_ctx->name);
 }
\ No newline at end of file