X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/f6ab9c9ababa2cf6e5c723b83ffb9362094054e8..6f6da1abb22dff69dbb710bd2fd9d95f083f2b43:/lunaix-os/hal/rtc/hwrtc.c diff --git a/lunaix-os/hal/rtc/hwrtc.c b/lunaix-os/hal/rtc/hwrtc.c index c3fc197..82f98eb 100644 --- a/lunaix-os/hal/rtc/hwrtc.c +++ b/lunaix-os/hal/rtc/hwrtc.c @@ -12,16 +12,11 @@ static int rtc_count = 0; DEFINE_LLIST(rtcs); -void -hwrtc_init() -{ - ptr_t init; - int index; - ldga_foreach(rtcdev, ptr_t, index, init) - { - ((void (*)())init)(); - } -} +// void +// hwrtc_init() +// { +// ldga_invoke_fn0(rtcdev); +// } void hwrtc_walltime(datetime_t* dt) @@ -74,7 +69,7 @@ hwrtc_read(struct device* dev, void* buf, size_t offset, size_t len) } struct hwrtc* -hwrtc_alloc_new(char* name) +hwrtc_alloc_new(struct device_def* def, char* name) { struct hwrtc* rtc_instance = valloc(sizeof(struct hwrtc)); @@ -90,7 +85,7 @@ hwrtc_alloc_new(char* name) rtc_instance->name = name; struct device* rtcdev = - device_addsys(NULL, rtc_instance, "rtc%d", rtc_count); + device_addsys(NULL, &def->class, rtc_instance, "rtc%d", rtc_count); rtcdev->ops.exec_cmd = hwrtc_ioctl; rtcdev->ops.read = hwrtc_read;