aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/chips/ds1374.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-03-23 18:51:32 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-23 18:51:32 -0500
commitb6585dedac232ca79fe978d97a95fdaa6da24f66 (patch)
tree4d2d78300bb9bcfb40cb35450f78dd3af82c78d3 /drivers/i2c/chips/ds1374.c
parenta3ea9b584ed2acdeae817f0dc91a5880e0828a05 (diff)
parentded2b66615613093eeb83b81499bc270de8fc499 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/i2c-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/i2c-2.6: (36 commits) [PATCH] hwmon: add required idr locking [PATCH] I2C: hwmon: Rename register parameters [PATCH] I2C: Drop unneeded i2c-dev.h includes [PATCH] I2C: i2c-ixp4xx: Add hwmon class [PATCH] I2C: i2c-piix4: Add Broadcom HT-1000 support [PATCH] I2C: i2c-amd756-s4882: Improve static mutex initialization [PATCH] I2C: i2c-ali1535: Drop redundant mutex [PATCH] i2c: Cleanup isp1301_omap [PATCH] i2c: Fix i2c-ite name initialization [PATCH] i2c: Drop the i2c-frodo bus driver [PATCH] i2c: Optimize core_lists mutex usage [PATCH] w83781d: Don't reset the chip by default [PATCH] w83781d: Document the alarm and beep bits [PATCH] w83627ehf: Refactor the sysfs interface [PATCH] hwmon: Support the Pentium M VID code [PATCH] hwmon: Add support for the Winbond W83687THF [PATCH] hwmon: f71805f semaphore to mutex conversions [PATCH] hwmon: Semaphore to mutex conversions [PATCH] i2c: Semaphore to mutex conversions, part 3 [PATCH] i2c: Semaphore to mutex conversions, part 2 ...
Diffstat (limited to 'drivers/i2c/chips/ds1374.c')
-rw-r--r--drivers/i2c/chips/ds1374.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/i2c/chips/ds1374.c b/drivers/i2c/chips/ds1374.c
index 0710b9da9d54..03d09ed5ec2c 100644
--- a/drivers/i2c/chips/ds1374.c
+++ b/drivers/i2c/chips/ds1374.c
@@ -26,6 +26,7 @@
26#include <linux/i2c.h> 26#include <linux/i2c.h>
27#include <linux/rtc.h> 27#include <linux/rtc.h>
28#include <linux/bcd.h> 28#include <linux/bcd.h>
29#include <linux/mutex.h>
29 30
30#define DS1374_REG_TOD0 0x00 31#define DS1374_REG_TOD0 0x00
31#define DS1374_REG_TOD1 0x01 32#define DS1374_REG_TOD1 0x01
@@ -41,7 +42,7 @@
41 42
42#define DS1374_DRV_NAME "ds1374" 43#define DS1374_DRV_NAME "ds1374"
43 44
44static DECLARE_MUTEX(ds1374_mutex); 45static DEFINE_MUTEX(ds1374_mutex);
45 46
46static struct i2c_driver ds1374_driver; 47static struct i2c_driver ds1374_driver;
47static struct i2c_client *save_client; 48static struct i2c_client *save_client;
@@ -114,7 +115,7 @@ ulong ds1374_get_rtc_time(void)
114 ulong t1, t2; 115 ulong t1, t2;
115 int limit = 10; /* arbitrary retry limit */ 116 int limit = 10; /* arbitrary retry limit */
116 117
117 down(&ds1374_mutex); 118 mutex_lock(&ds1374_mutex);
118 119
119 /* 120 /*
120 * Since the reads are being performed one byte at a time using 121 * Since the reads are being performed one byte at a time using
@@ -127,7 +128,7 @@ ulong ds1374_get_rtc_time(void)
127 t2 = ds1374_read_rtc(); 128 t2 = ds1374_read_rtc();
128 } while (t1 != t2 && limit--); 129 } while (t1 != t2 && limit--);
129 130
130 up(&ds1374_mutex); 131 mutex_unlock(&ds1374_mutex);
131 132
132 if (t1 != t2) { 133 if (t1 != t2) {
133 dev_warn(&save_client->dev, 134 dev_warn(&save_client->dev,
@@ -145,7 +146,7 @@ static void ds1374_set_tlet(ulong arg)
145 146
146 t1 = *(ulong *) arg; 147 t1 = *(ulong *) arg;
147 148
148 down(&ds1374_mutex); 149 mutex_lock(&ds1374_mutex);
149 150
150 /* 151 /*
151 * Since the writes are being performed one byte at a time using 152 * Since the writes are being performed one byte at a time using
@@ -158,7 +159,7 @@ static void ds1374_set_tlet(ulong arg)
158 t2 = ds1374_read_rtc(); 159 t2 = ds1374_read_rtc();
159 } while (t1 != t2 && limit--); 160 } while (t1 != t2 && limit--);
160 161
161 up(&ds1374_mutex); 162 mutex_unlock(&ds1374_mutex);
162 163
163 if (t1 != t2) 164 if (t1 != t2)
164 dev_warn(&save_client->dev, 165 dev_warn(&save_client->dev,