]> err.no Git - linux-2.6/commitdiff
[PATCH] I2C: use time_after in 3 chip drivers
authorJean Delvare <khali@linux-fr.org>
Fri, 29 Jul 2005 19:15:12 +0000 (12:15 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Fri, 29 Jul 2005 20:12:50 +0000 (13:12 -0700)
A few i2c drivers were not updated to use time_after() yet.

Signed-off-by: Marcelo Feitoza Parisi <marcelo@feitoza.com.br>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/hwmon/atxp1.c
drivers/hwmon/fscpos.c
drivers/hwmon/gl520sm.c

index 0bcf82b4c07bda60c7bcb08345a5a2bcb2b23ed9..fca3fc1cef72f02c1217d32cbfc0fa8876c63e40 100644 (file)
@@ -21,6 +21,7 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/module.h>
+#include <linux/jiffies.h>
 #include <linux/i2c.h>
 #include <linux/i2c-sensor.h>
 #include <linux/i2c-vid.h>
@@ -80,9 +81,7 @@ static struct atxp1_data * atxp1_update_device(struct device *dev)
 
        down(&data->update_lock);
 
-       if ((jiffies - data->last_updated > HZ) ||
-           (jiffies < data->last_updated) ||
-           !data->valid) {
+       if (time_after(jiffies, data->last_updated + HZ) || !data->valid) {
 
                /* Update local register data */
                data->reg.vid = i2c_smbus_read_byte_data(client, ATXP1_VID);
index 3beaa6191ef4ca5b6ba926fdc9c864d66d145ccc..270015b626adefcc3fe66cd41fefc2391bb33706 100644 (file)
@@ -32,6 +32,7 @@
 
 #include <linux/module.h>
 #include <linux/slab.h>
+#include <linux/jiffies.h>
 #include <linux/i2c.h>
 #include <linux/i2c-sensor.h>
 #include <linux/init.h>
@@ -572,8 +573,7 @@ static struct fscpos_data *fscpos_update_device(struct device *dev)
 
        down(&data->update_lock);
 
-       if ((jiffies - data->last_updated > 2 * HZ) ||
-                       (jiffies < data->last_updated) || !data->valid) {
+       if (time_after(jiffies, data->last_updated + 2 * HZ) || !data->valid) {
                int i;
 
                dev_dbg(&client->dev, "Starting fscpos update\n");
index a13a504f5bfa621fe4b2977f0ea9b2e3a2d33e7f..80ae8d30c2afc4d556f054a0f6e7fbcf1a0d627e 100644 (file)
@@ -24,6 +24,7 @@
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/slab.h>
+#include <linux/jiffies.h>
 #include <linux/i2c.h>
 #include <linux/i2c-sensor.h>
 #include <linux/i2c-vid.h>
@@ -678,8 +679,7 @@ static struct gl520_data *gl520_update_device(struct device *dev)
 
        down(&data->update_lock);
 
-       if ((jiffies - data->last_updated > 2 * HZ) ||
-           (jiffies < data->last_updated) || !data->valid) {
+       if (time_after(jiffies, data->last_updated + 2 * HZ) || !data->valid) {
 
                dev_dbg(&client->dev, "Starting gl520sm update\n");