rewrite the device subsystem interfaces (#48)
[lunaix-os.git] / lunaix-os / kernel / time / clock.c
index 3170731b842c340398227f33f898a61e2baf4060..a5b9dd838a6a04e119f3ef28a082d0ddec455d5e 100644 (file)
@@ -19,12 +19,8 @@ __clock_read_datetime(struct twimap* map)
     clock_walltime(&dt);
     twimap_printf(map,
                   "%.4d-%.2d-%.2d %.2d:%.2d:%.2d",
     clock_walltime(&dt);
     twimap_printf(map,
                   "%.4d-%.2d-%.2d %.2d:%.2d:%.2d",
-                  dt.year,
-                  dt.month,
-                  dt.day,
-                  dt.hour,
-                  dt.minute,
-                  dt.second);
+                  dt.year, dt.month, dt.day,
+                  dt.hour, dt.minute, dt.second);
 }
 
 void
 }
 
 void
@@ -78,20 +74,5 @@ clock_systime()
 void
 clock_walltime(datetime_t* datetime)
 {
 void
 clock_walltime(datetime_t* datetime)
 {
-    sysrtc->get_walltime(sysrtc, datetime);
-}
-
-void
-clock_init()
-{
-    int idx = 0;
-    struct device_def* pos;
-    foreach_exported_device_of(load_timedev, idx, pos)
-    {
-        if (pos->class.device != DEV_RTC) {
-            continue;
-        }
-
-        pos->init(pos);
-    }
+    sysrtc->ops->get_walltime(sysrtc, datetime);
 }
\ No newline at end of file
 }
\ No newline at end of file