]> err.no Git - linux-2.6/blobdiff - drivers/input/joydev.c
[PATCH] 3c59x: read current link status from phy
[linux-2.6] / drivers / input / joydev.c
index 816a585a0e6b7c163baba3056c7d7beb7874257d..e0938d1d3ad791cba54a319f454d61111066ecb2 100644 (file)
@@ -37,8 +37,6 @@ MODULE_LICENSE("GPL");
 #define JOYDEV_MINORS          16
 #define JOYDEV_BUFFER_SIZE     64
 
-#define MSECS(t)       (1000 * ((t) / HZ) + 1000 * ((t) % HZ) / HZ)
-
 struct joydev {
        int exist;
        int open;
@@ -117,7 +115,7 @@ static void joydev_event(struct input_handle *handle, unsigned int type, unsigne
                        return;
        }
 
-       event.time = MSECS(jiffies);
+       event.time = jiffies_to_msecs(jiffies);
 
        list_for_each_entry(list, &joydev->list, node) {
 
@@ -245,7 +243,7 @@ static ssize_t joydev_read(struct file *file, char __user *buf, size_t count, lo
 
                struct js_event event;
 
-               event.time = MSECS(jiffies);
+               event.time = jiffies_to_msecs(jiffies);
 
                if (list->startup < joydev->nkey) {
                        event.type = JS_EVENT_BUTTON | JS_EVENT_INIT;
@@ -518,9 +516,9 @@ static struct input_handle *joydev_connect(struct input_handler *handler, struct
 
        devfs_mk_cdev(MKDEV(INPUT_MAJOR, JOYDEV_MINOR_BASE + minor),
                        S_IFCHR|S_IRUGO|S_IWUSR, "input/js%d", minor);
-       class_simple_device_add(input_class,
-                               MKDEV(INPUT_MAJOR, JOYDEV_MINOR_BASE + minor),
-                               dev->dev, "js%d", minor);
+       class_device_create(input_class,
+                       MKDEV(INPUT_MAJOR, JOYDEV_MINOR_BASE + minor),
+                       dev->dev, "js%d", minor);
 
        return &joydev->handle;
 }
@@ -530,7 +528,7 @@ static void joydev_disconnect(struct input_handle *handle)
        struct joydev *joydev = handle->private;
        struct joydev_list *list;
 
-       class_simple_device_remove(MKDEV(INPUT_MAJOR, JOYDEV_MINOR_BASE + joydev->minor));
+       class_device_destroy(input_class, MKDEV(INPUT_MAJOR, JOYDEV_MINOR_BASE + joydev->minor));
        devfs_remove("input/js%d", joydev->minor);
        joydev->exist = 0;