[patch 09/29] I2C: use time_after in 3 chip drivers

From: Greg KH
Date: Fri Jul 29 2005 - 14:24:20 EST


From: Jean Delvare <khali@xxxxxxxxxxxx>

A few i2c drivers were not updated to use time_after() yet.

Signed-off-by: Marcelo Feitoza Parisi <marcelo@xxxxxxxxxxxxxx>
Signed-off-by: Jean Delvare <khali@xxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>


---
drivers/hwmon/atxp1.c | 5 ++---
drivers/hwmon/fscpos.c | 4 ++--
drivers/hwmon/gl520sm.c | 4 ++--
3 files changed, 6 insertions(+), 7 deletions(-)

--- gregkh-2.6.orig/drivers/hwmon/atxp1.c 2005-07-29 11:29:59.000000000 -0700
+++ gregkh-2.6/drivers/hwmon/atxp1.c 2005-07-29 11:34:03.000000000 -0700
@@ -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 @@

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);
--- gregkh-2.6.orig/drivers/hwmon/fscpos.c 2005-07-29 11:29:59.000000000 -0700
+++ gregkh-2.6/drivers/hwmon/fscpos.c 2005-07-29 11:34:03.000000000 -0700
@@ -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 @@

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");
--- gregkh-2.6.orig/drivers/hwmon/gl520sm.c 2005-07-29 11:29:59.000000000 -0700
+++ gregkh-2.6/drivers/hwmon/gl520sm.c 2005-07-29 11:34:03.000000000 -0700
@@ -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 @@

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");


--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/