ucmb: Fix msg_delay, if the value is >= 1sec
authorMichael Büsch <mb@bu3sch.de>
Sat, 7 Mar 2009 12:59:14 +0000 (12:59 +0000)
committerMichael Büsch <mb@bu3sch.de>
Sat, 7 Mar 2009 12:59:14 +0000 (12:59 +0000)
SVN-Revision: 14771

utils/ucmb/driver/ucmb.c

index 9b89408..7842d77 100644 (file)
@@ -354,7 +354,7 @@ static ssize_t ucmb_write(struct file *filp, const char __user *user_buf,
                /* The microcontroller deserves some time to process the message. */
                if (ucmb->msg_delay_usec >= 1000000) {
                        ssleep(ucmb->msg_delay_usec / 1000000);
-                       msleep(DIV_ROUND_UP(ucmb->msg_delay_usec, 1000));
+                       msleep(DIV_ROUND_UP(ucmb->msg_delay_usec % 1000000, 1000));
                } else if (ucmb->msg_delay_usec >= 1000) {
                        msleep(DIV_ROUND_UP(ucmb->msg_delay_usec, 1000));
                } else