summaryrefslogtreecommitdiffstats
path: root/drivers/i2c/chips/ds1374.c
diff options
context:
space:
mode:
authorArjan van de Ven <arjan@infradead.org>2006-01-11 10:50:26 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2006-03-23 14:21:49 -0800
commitb3585e4f5b3e4ddb4d82ae50d0b844f619c6d821 (patch)
tree5375363cc6087d74196efc0ded6dae9a8a4c2ad5 /drivers/i2c/chips/ds1374.c
parent2488a39d233a758d41ab7de70a220bc956f3c96c (diff)
downloadtalos-op-linux-b3585e4f5b3e4ddb4d82ae50d0b844f619c6d821.tar.gz
talos-op-linux-b3585e4f5b3e4ddb4d82ae50d0b844f619c6d821.zip
[PATCH] I2C: Convert i2c to mutexes
The patch below converts a few i2c semaphores to mutexes Signed-off-by: Arjan van de Ven <arjan@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
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 @@
#include <linux/i2c.h>
#include <linux/rtc.h>
#include <linux/bcd.h>
+#include <linux/mutex.h>
#define DS1374_REG_TOD0 0x00
#define DS1374_REG_TOD1 0x01
@@ -41,7 +42,7 @@
#define DS1374_DRV_NAME "ds1374"
-static DECLARE_MUTEX(ds1374_mutex);
+static DEFINE_MUTEX(ds1374_mutex);
static struct i2c_driver ds1374_driver;
static struct i2c_client *save_client;
@@ -114,7 +115,7 @@ ulong ds1374_get_rtc_time(void)
ulong t1, t2;
int limit = 10; /* arbitrary retry limit */
- down(&ds1374_mutex);
+ mutex_lock(&ds1374_mutex);
/*
* Since the reads are being performed one byte at a time using
@@ -127,7 +128,7 @@ ulong ds1374_get_rtc_time(void)
t2 = ds1374_read_rtc();
} while (t1 != t2 && limit--);
- up(&ds1374_mutex);
+ mutex_unlock(&ds1374_mutex);
if (t1 != t2) {
dev_warn(&save_client->dev,
@@ -145,7 +146,7 @@ static void ds1374_set_tlet(ulong arg)
t1 = *(ulong *) arg;
- down(&ds1374_mutex);
+ mutex_lock(&ds1374_mutex);
/*
* Since the writes are being performed one byte at a time using
@@ -158,7 +159,7 @@ static void ds1374_set_tlet(ulong arg)
t2 = ds1374_read_rtc();
} while (t1 != t2 && limit--);
- up(&ds1374_mutex);
+ mutex_unlock(&ds1374_mutex);
if (t1 != t2)
dev_warn(&save_client->dev,
OpenPOWER on IntegriCloud