5-malloc.md (#25)
[lunaix-os.git] / lunaix-os / kernel / device / input.c
index 252993f934d56bef8041e0c0af57e3ca92ebc05c..6ced39d0ad9efadf2e61d73bf2c6846cd1d79ebe 100644 (file)
@@ -9,7 +9,7 @@
 
 static DEFINE_LLIST(listener_chain);
 
 
 static DEFINE_LLIST(listener_chain);
 
-static struct device* input_devcat = NULL;
+static struct device_cat* input_devcat = NULL;
 
 void
 input_init()
 
 void
 input_init()
@@ -80,8 +80,10 @@ input_add_device(struct devclass* class, char* name_fmt, ...)
     va_list args;
     va_start(args, name_fmt);
 
     va_list args;
     va_start(args, name_fmt);
 
-    struct device* dev =
-      device_add_vargs(input_devcat, idev, name_fmt, DEV_IFSEQ, class, args);
+    struct device* dev = device_allocseq(dev_meta(input_devcat), idev);
+
+    device_setname_vargs(dev_meta(dev), name_fmt, args);
+    register_device(dev, class, NULL);
 
     idev->dev_if = dev;
     dev->ops.read = __input_dev_read;
 
     idev->dev_if = dev;
     dev->ops.read = __input_dev_read;