X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/6f6da1abb22dff69dbb710bd2fd9d95f083f2b43..8b8f49b713d64065775fe538232f8639083601bd:/lunaix-os/hal/timer/hwtimer.c diff --git a/lunaix-os/hal/timer/hwtimer.c b/lunaix-os/hal/timer/hwtimer.c index 4da1568..91dca07 100644 --- a/lunaix-os/hal/timer/hwtimer.c +++ b/lunaix-os/hal/timer/hwtimer.c @@ -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