diff options
author | Ingo Molnar <mingo@elte.hu> | 2006-01-18 17:16:04 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-03-23 17:21:51 -0500 |
commit | 5c085d369c2c4f18942ec8951466e186366d5c78 (patch) | |
tree | 22ca525700049a402281a0503b07db0645075f58 /drivers/i2c/busses | |
parent | 7656032b904b936eca65a41afa1f2b3603195657 (diff) |
[PATCH] i2c: Semaphore to mutex conversions, part 2
semaphore to mutex conversion.
the conversion was generated via scripts, and the result was validated
automatically via a script as well.
build tested.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/i2c/busses')
-rw-r--r-- | drivers/i2c/busses/i2c-amd756-s4882.c | 13 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-isa.c | 2 |
2 files changed, 8 insertions, 7 deletions
diff --git a/drivers/i2c/busses/i2c-amd756-s4882.c b/drivers/i2c/busses/i2c-amd756-s4882.c index 56c7d987590f..f7b4cb4e9c75 100644 --- a/drivers/i2c/busses/i2c-amd756-s4882.c +++ b/drivers/i2c/busses/i2c-amd756-s4882.c | |||
@@ -38,6 +38,7 @@ | |||
38 | #include <linux/slab.h> | 38 | #include <linux/slab.h> |
39 | #include <linux/init.h> | 39 | #include <linux/init.h> |
40 | #include <linux/i2c.h> | 40 | #include <linux/i2c.h> |
41 | #include <linux/mutex.h> | ||
41 | 42 | ||
42 | extern struct i2c_adapter amd756_smbus; | 43 | extern struct i2c_adapter amd756_smbus; |
43 | 44 | ||
@@ -45,7 +46,7 @@ static struct i2c_adapter *s4882_adapter; | |||
45 | static struct i2c_algorithm *s4882_algo; | 46 | static struct i2c_algorithm *s4882_algo; |
46 | 47 | ||
47 | /* Wrapper access functions for multiplexed SMBus */ | 48 | /* Wrapper access functions for multiplexed SMBus */ |
48 | static struct semaphore amd756_lock; | 49 | static struct mutex amd756_lock; |
49 | 50 | ||
50 | static s32 amd756_access_virt0(struct i2c_adapter * adap, u16 addr, | 51 | static s32 amd756_access_virt0(struct i2c_adapter * adap, u16 addr, |
51 | unsigned short flags, char read_write, | 52 | unsigned short flags, char read_write, |
@@ -59,12 +60,12 @@ static s32 amd756_access_virt0(struct i2c_adapter * adap, u16 addr, | |||
59 | || addr == 0x18) | 60 | || addr == 0x18) |
60 | return -1; | 61 | return -1; |
61 | 62 | ||
62 | down(&amd756_lock); | 63 | mutex_lock(&amd756_lock); |
63 | 64 | ||
64 | error = amd756_smbus.algo->smbus_xfer(adap, addr, flags, read_write, | 65 | error = amd756_smbus.algo->smbus_xfer(adap, addr, flags, read_write, |
65 | command, size, data); | 66 | command, size, data); |
66 | 67 | ||
67 | up(&amd756_lock); | 68 | mutex_unlock(&amd756_lock); |
68 | 69 | ||
69 | return error; | 70 | return error; |
70 | } | 71 | } |
@@ -87,7 +88,7 @@ static inline s32 amd756_access_channel(struct i2c_adapter * adap, u16 addr, | |||
87 | if (addr != 0x4c && (addr & 0xfc) != 0x50 && (addr & 0xfc) != 0x30) | 88 | if (addr != 0x4c && (addr & 0xfc) != 0x50 && (addr & 0xfc) != 0x30) |
88 | return -1; | 89 | return -1; |
89 | 90 | ||
90 | down(&amd756_lock); | 91 | mutex_lock(&amd756_lock); |
91 | 92 | ||
92 | if (last_channels != channels) { | 93 | if (last_channels != channels) { |
93 | union i2c_smbus_data mplxdata; | 94 | union i2c_smbus_data mplxdata; |
@@ -105,7 +106,7 @@ static inline s32 amd756_access_channel(struct i2c_adapter * adap, u16 addr, | |||
105 | command, size, data); | 106 | command, size, data); |
106 | 107 | ||
107 | UNLOCK: | 108 | UNLOCK: |
108 | up(&amd756_lock); | 109 | mutex_unlock(&amd756_lock); |
109 | return error; | 110 | return error; |
110 | } | 111 | } |
111 | 112 | ||
@@ -166,7 +167,7 @@ static int __init amd756_s4882_init(void) | |||
166 | } | 167 | } |
167 | 168 | ||
168 | printk(KERN_INFO "Enabling SMBus multiplexing for Tyan S4882\n"); | 169 | printk(KERN_INFO "Enabling SMBus multiplexing for Tyan S4882\n"); |
169 | init_MUTEX(&amd756_lock); | 170 | mutex_init(&amd756_lock); |
170 | 171 | ||
171 | /* Define the 5 virtual adapters and algorithms structures */ | 172 | /* Define the 5 virtual adapters and algorithms structures */ |
172 | if (!(s4882_adapter = kzalloc(5 * sizeof(struct i2c_adapter), | 173 | if (!(s4882_adapter = kzalloc(5 * sizeof(struct i2c_adapter), |
diff --git a/drivers/i2c/busses/i2c-isa.c b/drivers/i2c/busses/i2c-isa.c index 4344ae6b1fcb..c3e1d3e888d7 100644 --- a/drivers/i2c/busses/i2c-isa.c +++ b/drivers/i2c/busses/i2c-isa.c | |||
@@ -125,7 +125,7 @@ int i2c_isa_del_driver(struct i2c_driver *driver) | |||
125 | 125 | ||
126 | static int __init i2c_isa_init(void) | 126 | static int __init i2c_isa_init(void) |
127 | { | 127 | { |
128 | init_MUTEX(&isa_adapter.clist_lock); | 128 | mutex_init(&isa_adapter.clist_lock); |
129 | INIT_LIST_HEAD(&isa_adapter.clients); | 129 | INIT_LIST_HEAD(&isa_adapter.clients); |
130 | 130 | ||
131 | isa_adapter.nr = ANY_I2C_ISA_BUS; | 131 | isa_adapter.nr = ANY_I2C_ISA_BUS; |