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/chips | |
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/chips')
-rw-r--r-- | drivers/i2c/chips/eeprom.c | 9 | ||||
-rw-r--r-- | drivers/i2c/chips/max6875.c | 10 | ||||
-rw-r--r-- | drivers/i2c/chips/pcf8591.c | 13 | ||||
-rw-r--r-- | drivers/i2c/chips/tps65010.c | 45 |
4 files changed, 40 insertions, 37 deletions
diff --git a/drivers/i2c/chips/eeprom.c b/drivers/i2c/chips/eeprom.c index 41116b7947f6..13c108269a6d 100644 --- a/drivers/i2c/chips/eeprom.c +++ b/drivers/i2c/chips/eeprom.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #include <linux/sched.h> | 33 | #include <linux/sched.h> |
34 | #include <linux/jiffies.h> | 34 | #include <linux/jiffies.h> |
35 | #include <linux/i2c.h> | 35 | #include <linux/i2c.h> |
36 | #include <linux/mutex.h> | ||
36 | 37 | ||
37 | /* Addresses to scan */ | 38 | /* Addresses to scan */ |
38 | static unsigned short normal_i2c[] = { 0x50, 0x51, 0x52, 0x53, 0x54, | 39 | static unsigned short normal_i2c[] = { 0x50, 0x51, 0x52, 0x53, 0x54, |
@@ -54,7 +55,7 @@ enum eeprom_nature { | |||
54 | /* Each client has this additional data */ | 55 | /* Each client has this additional data */ |
55 | struct eeprom_data { | 56 | struct eeprom_data { |
56 | struct i2c_client client; | 57 | struct i2c_client client; |
57 | struct semaphore update_lock; | 58 | struct mutex update_lock; |
58 | u8 valid; /* bitfield, bit!=0 if slice is valid */ | 59 | u8 valid; /* bitfield, bit!=0 if slice is valid */ |
59 | unsigned long last_updated[8]; /* In jiffies, 8 slices */ | 60 | unsigned long last_updated[8]; /* In jiffies, 8 slices */ |
60 | u8 data[EEPROM_SIZE]; /* Register values */ | 61 | u8 data[EEPROM_SIZE]; /* Register values */ |
@@ -81,7 +82,7 @@ static void eeprom_update_client(struct i2c_client *client, u8 slice) | |||
81 | struct eeprom_data *data = i2c_get_clientdata(client); | 82 | struct eeprom_data *data = i2c_get_clientdata(client); |
82 | int i, j; | 83 | int i, j; |
83 | 84 | ||
84 | down(&data->update_lock); | 85 | mutex_lock(&data->update_lock); |
85 | 86 | ||
86 | if (!(data->valid & (1 << slice)) || | 87 | if (!(data->valid & (1 << slice)) || |
87 | time_after(jiffies, data->last_updated[slice] + 300 * HZ)) { | 88 | time_after(jiffies, data->last_updated[slice] + 300 * HZ)) { |
@@ -107,7 +108,7 @@ static void eeprom_update_client(struct i2c_client *client, u8 slice) | |||
107 | data->valid |= (1 << slice); | 108 | data->valid |= (1 << slice); |
108 | } | 109 | } |
109 | exit: | 110 | exit: |
110 | up(&data->update_lock); | 111 | mutex_unlock(&data->update_lock); |
111 | } | 112 | } |
112 | 113 | ||
113 | static ssize_t eeprom_read(struct kobject *kobj, char *buf, loff_t off, size_t count) | 114 | static ssize_t eeprom_read(struct kobject *kobj, char *buf, loff_t off, size_t count) |
@@ -187,7 +188,7 @@ static int eeprom_detect(struct i2c_adapter *adapter, int address, int kind) | |||
187 | /* Fill in the remaining client fields */ | 188 | /* Fill in the remaining client fields */ |
188 | strlcpy(new_client->name, "eeprom", I2C_NAME_SIZE); | 189 | strlcpy(new_client->name, "eeprom", I2C_NAME_SIZE); |
189 | data->valid = 0; | 190 | data->valid = 0; |
190 | init_MUTEX(&data->update_lock); | 191 | mutex_init(&data->update_lock); |
191 | data->nature = UNKNOWN; | 192 | data->nature = UNKNOWN; |
192 | 193 | ||
193 | /* Tell the I2C layer a new client has arrived */ | 194 | /* Tell the I2C layer a new client has arrived */ |
diff --git a/drivers/i2c/chips/max6875.c b/drivers/i2c/chips/max6875.c index 6d3ff584155e..88d2ddee4490 100644 --- a/drivers/i2c/chips/max6875.c +++ b/drivers/i2c/chips/max6875.c | |||
@@ -31,7 +31,7 @@ | |||
31 | #include <linux/module.h> | 31 | #include <linux/module.h> |
32 | #include <linux/slab.h> | 32 | #include <linux/slab.h> |
33 | #include <linux/i2c.h> | 33 | #include <linux/i2c.h> |
34 | #include <asm/semaphore.h> | 34 | #include <linux/mutex.h> |
35 | 35 | ||
36 | /* Do not scan - the MAX6875 access method will write to some EEPROM chips */ | 36 | /* Do not scan - the MAX6875 access method will write to some EEPROM chips */ |
37 | static unsigned short normal_i2c[] = {I2C_CLIENT_END}; | 37 | static unsigned short normal_i2c[] = {I2C_CLIENT_END}; |
@@ -54,7 +54,7 @@ I2C_CLIENT_INSMOD_1(max6875); | |||
54 | /* Each client has this additional data */ | 54 | /* Each client has this additional data */ |
55 | struct max6875_data { | 55 | struct max6875_data { |
56 | struct i2c_client client; | 56 | struct i2c_client client; |
57 | struct semaphore update_lock; | 57 | struct mutex update_lock; |
58 | 58 | ||
59 | u32 valid; | 59 | u32 valid; |
60 | u8 data[USER_EEPROM_SIZE]; | 60 | u8 data[USER_EEPROM_SIZE]; |
@@ -83,7 +83,7 @@ static void max6875_update_slice(struct i2c_client *client, int slice) | |||
83 | if (slice >= USER_EEPROM_SLICES) | 83 | if (slice >= USER_EEPROM_SLICES) |
84 | return; | 84 | return; |
85 | 85 | ||
86 | down(&data->update_lock); | 86 | mutex_lock(&data->update_lock); |
87 | 87 | ||
88 | buf = &data->data[slice << SLICE_BITS]; | 88 | buf = &data->data[slice << SLICE_BITS]; |
89 | 89 | ||
@@ -122,7 +122,7 @@ static void max6875_update_slice(struct i2c_client *client, int slice) | |||
122 | data->valid |= (1 << slice); | 122 | data->valid |= (1 << slice); |
123 | } | 123 | } |
124 | exit_up: | 124 | exit_up: |
125 | up(&data->update_lock); | 125 | mutex_unlock(&data->update_lock); |
126 | } | 126 | } |
127 | 127 | ||
128 | static ssize_t max6875_read(struct kobject *kobj, char *buf, loff_t off, | 128 | static ssize_t max6875_read(struct kobject *kobj, char *buf, loff_t off, |
@@ -196,7 +196,7 @@ static int max6875_detect(struct i2c_adapter *adapter, int address, int kind) | |||
196 | real_client->driver = &max6875_driver; | 196 | real_client->driver = &max6875_driver; |
197 | real_client->flags = 0; | 197 | real_client->flags = 0; |
198 | strlcpy(real_client->name, "max6875", I2C_NAME_SIZE); | 198 | strlcpy(real_client->name, "max6875", I2C_NAME_SIZE); |
199 | init_MUTEX(&data->update_lock); | 199 | mutex_init(&data->update_lock); |
200 | 200 | ||
201 | /* Init fake client data */ | 201 | /* Init fake client data */ |
202 | /* set the client data to the i2c_client so that it will get freed */ | 202 | /* set the client data to the i2c_client so that it will get freed */ |
diff --git a/drivers/i2c/chips/pcf8591.c b/drivers/i2c/chips/pcf8591.c index 36cff09c678d..925a6b371fd2 100644 --- a/drivers/i2c/chips/pcf8591.c +++ b/drivers/i2c/chips/pcf8591.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/init.h> | 24 | #include <linux/init.h> |
25 | #include <linux/slab.h> | 25 | #include <linux/slab.h> |
26 | #include <linux/i2c.h> | 26 | #include <linux/i2c.h> |
27 | #include <linux/mutex.h> | ||
27 | 28 | ||
28 | /* Addresses to scan */ | 29 | /* Addresses to scan */ |
29 | static unsigned short normal_i2c[] = { 0x48, 0x49, 0x4a, 0x4b, 0x4c, | 30 | static unsigned short normal_i2c[] = { 0x48, 0x49, 0x4a, 0x4b, 0x4c, |
@@ -74,7 +75,7 @@ MODULE_PARM_DESC(input_mode, | |||
74 | 75 | ||
75 | struct pcf8591_data { | 76 | struct pcf8591_data { |
76 | struct i2c_client client; | 77 | struct i2c_client client; |
77 | struct semaphore update_lock; | 78 | struct mutex update_lock; |
78 | 79 | ||
79 | u8 control; | 80 | u8 control; |
80 | u8 aout; | 81 | u8 aout; |
@@ -144,13 +145,13 @@ static ssize_t set_out0_enable(struct device *dev, struct device_attribute *attr | |||
144 | struct pcf8591_data *data = i2c_get_clientdata(client); | 145 | struct pcf8591_data *data = i2c_get_clientdata(client); |
145 | unsigned long val = simple_strtoul(buf, NULL, 10); | 146 | unsigned long val = simple_strtoul(buf, NULL, 10); |
146 | 147 | ||
147 | down(&data->update_lock); | 148 | mutex_lock(&data->update_lock); |
148 | if (val) | 149 | if (val) |
149 | data->control |= PCF8591_CONTROL_AOEF; | 150 | data->control |= PCF8591_CONTROL_AOEF; |
150 | else | 151 | else |
151 | data->control &= ~PCF8591_CONTROL_AOEF; | 152 | data->control &= ~PCF8591_CONTROL_AOEF; |
152 | i2c_smbus_write_byte(client, data->control); | 153 | i2c_smbus_write_byte(client, data->control); |
153 | up(&data->update_lock); | 154 | mutex_unlock(&data->update_lock); |
154 | return count; | 155 | return count; |
155 | } | 156 | } |
156 | 157 | ||
@@ -200,7 +201,7 @@ static int pcf8591_detect(struct i2c_adapter *adapter, int address, int kind) | |||
200 | /* Fill in the remaining client fields and put it into the global | 201 | /* Fill in the remaining client fields and put it into the global |
201 | list */ | 202 | list */ |
202 | strlcpy(new_client->name, "pcf8591", I2C_NAME_SIZE); | 203 | strlcpy(new_client->name, "pcf8591", I2C_NAME_SIZE); |
203 | init_MUTEX(&data->update_lock); | 204 | mutex_init(&data->update_lock); |
204 | 205 | ||
205 | /* Tell the I2C layer a new client has arrived */ | 206 | /* Tell the I2C layer a new client has arrived */ |
206 | if ((err = i2c_attach_client(new_client))) | 207 | if ((err = i2c_attach_client(new_client))) |
@@ -265,7 +266,7 @@ static int pcf8591_read_channel(struct device *dev, int channel) | |||
265 | struct i2c_client *client = to_i2c_client(dev); | 266 | struct i2c_client *client = to_i2c_client(dev); |
266 | struct pcf8591_data *data = i2c_get_clientdata(client); | 267 | struct pcf8591_data *data = i2c_get_clientdata(client); |
267 | 268 | ||
268 | down(&data->update_lock); | 269 | mutex_lock(&data->update_lock); |
269 | 270 | ||
270 | if ((data->control & PCF8591_CONTROL_AICH_MASK) != channel) { | 271 | if ((data->control & PCF8591_CONTROL_AICH_MASK) != channel) { |
271 | data->control = (data->control & ~PCF8591_CONTROL_AICH_MASK) | 272 | data->control = (data->control & ~PCF8591_CONTROL_AICH_MASK) |
@@ -278,7 +279,7 @@ static int pcf8591_read_channel(struct device *dev, int channel) | |||
278 | } | 279 | } |
279 | value = i2c_smbus_read_byte(client); | 280 | value = i2c_smbus_read_byte(client); |
280 | 281 | ||
281 | up(&data->update_lock); | 282 | mutex_unlock(&data->update_lock); |
282 | 283 | ||
283 | if ((channel == 2 && input_mode == 2) || | 284 | if ((channel == 2 && input_mode == 2) || |
284 | (channel != 3 && (input_mode == 1 || input_mode == 3))) | 285 | (channel != 3 && (input_mode == 1 || input_mode == 3))) |
diff --git a/drivers/i2c/chips/tps65010.c b/drivers/i2c/chips/tps65010.c index 1af3dfbb8086..179b1e022d80 100644 --- a/drivers/i2c/chips/tps65010.c +++ b/drivers/i2c/chips/tps65010.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <linux/suspend.h> | 32 | #include <linux/suspend.h> |
33 | #include <linux/debugfs.h> | 33 | #include <linux/debugfs.h> |
34 | #include <linux/seq_file.h> | 34 | #include <linux/seq_file.h> |
35 | #include <linux/mutex.h> | ||
35 | 36 | ||
36 | #include <asm/irq.h> | 37 | #include <asm/irq.h> |
37 | #include <asm/mach-types.h> | 38 | #include <asm/mach-types.h> |
@@ -81,7 +82,7 @@ enum tps_model { | |||
81 | 82 | ||
82 | struct tps65010 { | 83 | struct tps65010 { |
83 | struct i2c_client client; | 84 | struct i2c_client client; |
84 | struct semaphore lock; | 85 | struct mutex lock; |
85 | int irq; | 86 | int irq; |
86 | struct work_struct work; | 87 | struct work_struct work; |
87 | struct dentry *file; | 88 | struct dentry *file; |
@@ -218,7 +219,7 @@ static int dbg_show(struct seq_file *s, void *_) | |||
218 | seq_printf(s, "driver %s\nversion %s\nchip %s\n\n", | 219 | seq_printf(s, "driver %s\nversion %s\nchip %s\n\n", |
219 | DRIVER_NAME, DRIVER_VERSION, chip); | 220 | DRIVER_NAME, DRIVER_VERSION, chip); |
220 | 221 | ||
221 | down(&tps->lock); | 222 | mutex_lock(&tps->lock); |
222 | 223 | ||
223 | /* FIXME how can we tell whether a battery is present? | 224 | /* FIXME how can we tell whether a battery is present? |
224 | * likely involves a charge gauging chip (like BQ26501). | 225 | * likely involves a charge gauging chip (like BQ26501). |
@@ -300,7 +301,7 @@ static int dbg_show(struct seq_file *s, void *_) | |||
300 | (v2 & (1 << (4 + i))) ? "rising" : "falling"); | 301 | (v2 & (1 << (4 + i))) ? "rising" : "falling"); |
301 | } | 302 | } |
302 | 303 | ||
303 | up(&tps->lock); | 304 | mutex_unlock(&tps->lock); |
304 | return 0; | 305 | return 0; |
305 | } | 306 | } |
306 | 307 | ||
@@ -416,7 +417,7 @@ static void tps65010_work(void *_tps) | |||
416 | { | 417 | { |
417 | struct tps65010 *tps = _tps; | 418 | struct tps65010 *tps = _tps; |
418 | 419 | ||
419 | down(&tps->lock); | 420 | mutex_lock(&tps->lock); |
420 | 421 | ||
421 | tps65010_interrupt(tps); | 422 | tps65010_interrupt(tps); |
422 | 423 | ||
@@ -444,7 +445,7 @@ static void tps65010_work(void *_tps) | |||
444 | if (test_and_clear_bit(FLAG_IRQ_ENABLE, &tps->flags)) | 445 | if (test_and_clear_bit(FLAG_IRQ_ENABLE, &tps->flags)) |
445 | enable_irq(tps->irq); | 446 | enable_irq(tps->irq); |
446 | 447 | ||
447 | up(&tps->lock); | 448 | mutex_unlock(&tps->lock); |
448 | } | 449 | } |
449 | 450 | ||
450 | static irqreturn_t tps65010_irq(int irq, void *_tps, struct pt_regs *regs) | 451 | static irqreturn_t tps65010_irq(int irq, void *_tps, struct pt_regs *regs) |
@@ -505,7 +506,7 @@ tps65010_probe(struct i2c_adapter *bus, int address, int kind) | |||
505 | if (!tps) | 506 | if (!tps) |
506 | return 0; | 507 | return 0; |
507 | 508 | ||
508 | init_MUTEX(&tps->lock); | 509 | mutex_init(&tps->lock); |
509 | INIT_WORK(&tps->work, tps65010_work, tps); | 510 | INIT_WORK(&tps->work, tps65010_work, tps); |
510 | tps->irq = -1; | 511 | tps->irq = -1; |
511 | tps->client.addr = address; | 512 | tps->client.addr = address; |
@@ -695,7 +696,7 @@ int tps65010_set_gpio_out_value(unsigned gpio, unsigned value) | |||
695 | if ((gpio < GPIO1) || (gpio > GPIO4)) | 696 | if ((gpio < GPIO1) || (gpio > GPIO4)) |
696 | return -EINVAL; | 697 | return -EINVAL; |
697 | 698 | ||
698 | down(&the_tps->lock); | 699 | mutex_lock(&the_tps->lock); |
699 | 700 | ||
700 | defgpio = i2c_smbus_read_byte_data(&the_tps->client, TPS_DEFGPIO); | 701 | defgpio = i2c_smbus_read_byte_data(&the_tps->client, TPS_DEFGPIO); |
701 | 702 | ||
@@ -720,7 +721,7 @@ int tps65010_set_gpio_out_value(unsigned gpio, unsigned value) | |||
720 | gpio, value ? "high" : "low", | 721 | gpio, value ? "high" : "low", |
721 | i2c_smbus_read_byte_data(&the_tps->client, TPS_DEFGPIO)); | 722 | i2c_smbus_read_byte_data(&the_tps->client, TPS_DEFGPIO)); |
722 | 723 | ||
723 | up(&the_tps->lock); | 724 | mutex_unlock(&the_tps->lock); |
724 | return status; | 725 | return status; |
725 | } | 726 | } |
726 | EXPORT_SYMBOL(tps65010_set_gpio_out_value); | 727 | EXPORT_SYMBOL(tps65010_set_gpio_out_value); |
@@ -745,7 +746,7 @@ int tps65010_set_led(unsigned led, unsigned mode) | |||
745 | led = LED2; | 746 | led = LED2; |
746 | } | 747 | } |
747 | 748 | ||
748 | down(&the_tps->lock); | 749 | mutex_lock(&the_tps->lock); |
749 | 750 | ||
750 | pr_debug("%s: led%i_on 0x%02x\n", DRIVER_NAME, led, | 751 | pr_debug("%s: led%i_on 0x%02x\n", DRIVER_NAME, led, |
751 | i2c_smbus_read_byte_data(&the_tps->client, | 752 | i2c_smbus_read_byte_data(&the_tps->client, |
@@ -771,7 +772,7 @@ int tps65010_set_led(unsigned led, unsigned mode) | |||
771 | default: | 772 | default: |
772 | printk(KERN_ERR "%s: Wrong mode parameter for set_led()\n", | 773 | printk(KERN_ERR "%s: Wrong mode parameter for set_led()\n", |
773 | DRIVER_NAME); | 774 | DRIVER_NAME); |
774 | up(&the_tps->lock); | 775 | mutex_unlock(&the_tps->lock); |
775 | return -EINVAL; | 776 | return -EINVAL; |
776 | } | 777 | } |
777 | 778 | ||
@@ -781,7 +782,7 @@ int tps65010_set_led(unsigned led, unsigned mode) | |||
781 | if (status != 0) { | 782 | if (status != 0) { |
782 | printk(KERN_ERR "%s: Failed to write led%i_on register\n", | 783 | printk(KERN_ERR "%s: Failed to write led%i_on register\n", |
783 | DRIVER_NAME, led); | 784 | DRIVER_NAME, led); |
784 | up(&the_tps->lock); | 785 | mutex_unlock(&the_tps->lock); |
785 | return status; | 786 | return status; |
786 | } | 787 | } |
787 | 788 | ||
@@ -794,7 +795,7 @@ int tps65010_set_led(unsigned led, unsigned mode) | |||
794 | if (status != 0) { | 795 | if (status != 0) { |
795 | printk(KERN_ERR "%s: Failed to write led%i_per register\n", | 796 | printk(KERN_ERR "%s: Failed to write led%i_per register\n", |
796 | DRIVER_NAME, led); | 797 | DRIVER_NAME, led); |
797 | up(&the_tps->lock); | 798 | mutex_unlock(&the_tps->lock); |
798 | return status; | 799 | return status; |
799 | } | 800 | } |
800 | 801 | ||
@@ -802,7 +803,7 @@ int tps65010_set_led(unsigned led, unsigned mode) | |||
802 | i2c_smbus_read_byte_data(&the_tps->client, | 803 | i2c_smbus_read_byte_data(&the_tps->client, |
803 | TPS_LED1_PER + offs)); | 804 | TPS_LED1_PER + offs)); |
804 | 805 | ||
805 | up(&the_tps->lock); | 806 | mutex_unlock(&the_tps->lock); |
806 | 807 | ||
807 | return status; | 808 | return status; |
808 | } | 809 | } |
@@ -820,7 +821,7 @@ int tps65010_set_vib(unsigned value) | |||
820 | if (!the_tps) | 821 | if (!the_tps) |
821 | return -ENODEV; | 822 | return -ENODEV; |
822 | 823 | ||
823 | down(&the_tps->lock); | 824 | mutex_lock(&the_tps->lock); |
824 | 825 | ||
825 | vdcdc2 = i2c_smbus_read_byte_data(&the_tps->client, TPS_VDCDC2); | 826 | vdcdc2 = i2c_smbus_read_byte_data(&the_tps->client, TPS_VDCDC2); |
826 | vdcdc2 &= ~(1 << 1); | 827 | vdcdc2 &= ~(1 << 1); |
@@ -831,7 +832,7 @@ int tps65010_set_vib(unsigned value) | |||
831 | 832 | ||
832 | pr_debug("%s: vibrator %s\n", DRIVER_NAME, value ? "on" : "off"); | 833 | pr_debug("%s: vibrator %s\n", DRIVER_NAME, value ? "on" : "off"); |
833 | 834 | ||
834 | up(&the_tps->lock); | 835 | mutex_unlock(&the_tps->lock); |
835 | return status; | 836 | return status; |
836 | } | 837 | } |
837 | EXPORT_SYMBOL(tps65010_set_vib); | 838 | EXPORT_SYMBOL(tps65010_set_vib); |
@@ -848,7 +849,7 @@ int tps65010_set_low_pwr(unsigned mode) | |||
848 | if (!the_tps) | 849 | if (!the_tps) |
849 | return -ENODEV; | 850 | return -ENODEV; |
850 | 851 | ||
851 | down(&the_tps->lock); | 852 | mutex_lock(&the_tps->lock); |
852 | 853 | ||
853 | pr_debug("%s: %s low_pwr, vdcdc1 0x%02x\n", DRIVER_NAME, | 854 | pr_debug("%s: %s low_pwr, vdcdc1 0x%02x\n", DRIVER_NAME, |
854 | mode ? "enable" : "disable", | 855 | mode ? "enable" : "disable", |
@@ -876,7 +877,7 @@ int tps65010_set_low_pwr(unsigned mode) | |||
876 | pr_debug("%s: vdcdc1 0x%02x\n", DRIVER_NAME, | 877 | pr_debug("%s: vdcdc1 0x%02x\n", DRIVER_NAME, |
877 | i2c_smbus_read_byte_data(&the_tps->client, TPS_VDCDC1)); | 878 | i2c_smbus_read_byte_data(&the_tps->client, TPS_VDCDC1)); |
878 | 879 | ||
879 | up(&the_tps->lock); | 880 | mutex_unlock(&the_tps->lock); |
880 | 881 | ||
881 | return status; | 882 | return status; |
882 | } | 883 | } |
@@ -894,7 +895,7 @@ int tps65010_config_vregs1(unsigned value) | |||
894 | if (!the_tps) | 895 | if (!the_tps) |
895 | return -ENODEV; | 896 | return -ENODEV; |
896 | 897 | ||
897 | down(&the_tps->lock); | 898 | mutex_lock(&the_tps->lock); |
898 | 899 | ||
899 | pr_debug("%s: vregs1 0x%02x\n", DRIVER_NAME, | 900 | pr_debug("%s: vregs1 0x%02x\n", DRIVER_NAME, |
900 | i2c_smbus_read_byte_data(&the_tps->client, TPS_VREGS1)); | 901 | i2c_smbus_read_byte_data(&the_tps->client, TPS_VREGS1)); |
@@ -909,7 +910,7 @@ int tps65010_config_vregs1(unsigned value) | |||
909 | pr_debug("%s: vregs1 0x%02x\n", DRIVER_NAME, | 910 | pr_debug("%s: vregs1 0x%02x\n", DRIVER_NAME, |
910 | i2c_smbus_read_byte_data(&the_tps->client, TPS_VREGS1)); | 911 | i2c_smbus_read_byte_data(&the_tps->client, TPS_VREGS1)); |
911 | 912 | ||
912 | up(&the_tps->lock); | 913 | mutex_unlock(&the_tps->lock); |
913 | 914 | ||
914 | return status; | 915 | return status; |
915 | } | 916 | } |
@@ -931,7 +932,7 @@ int tps65013_set_low_pwr(unsigned mode) | |||
931 | if (!the_tps || the_tps->por) | 932 | if (!the_tps || the_tps->por) |
932 | return -ENODEV; | 933 | return -ENODEV; |
933 | 934 | ||
934 | down(&the_tps->lock); | 935 | mutex_lock(&the_tps->lock); |
935 | 936 | ||
936 | pr_debug("%s: %s low_pwr, chgconfig 0x%02x vdcdc1 0x%02x\n", | 937 | pr_debug("%s: %s low_pwr, chgconfig 0x%02x vdcdc1 0x%02x\n", |
937 | DRIVER_NAME, | 938 | DRIVER_NAME, |
@@ -959,7 +960,7 @@ int tps65013_set_low_pwr(unsigned mode) | |||
959 | if (status != 0) { | 960 | if (status != 0) { |
960 | printk(KERN_ERR "%s: Failed to write chconfig register\n", | 961 | printk(KERN_ERR "%s: Failed to write chconfig register\n", |
961 | DRIVER_NAME); | 962 | DRIVER_NAME); |
962 | up(&the_tps->lock); | 963 | mutex_unlock(&the_tps->lock); |
963 | return status; | 964 | return status; |
964 | } | 965 | } |
965 | 966 | ||
@@ -977,7 +978,7 @@ int tps65013_set_low_pwr(unsigned mode) | |||
977 | pr_debug("%s: vdcdc1 0x%02x\n", DRIVER_NAME, | 978 | pr_debug("%s: vdcdc1 0x%02x\n", DRIVER_NAME, |
978 | i2c_smbus_read_byte_data(&the_tps->client, TPS_VDCDC1)); | 979 | i2c_smbus_read_byte_data(&the_tps->client, TPS_VDCDC1)); |
979 | 980 | ||
980 | up(&the_tps->lock); | 981 | mutex_unlock(&the_tps->lock); |
981 | 982 | ||
982 | return status; | 983 | return status; |
983 | } | 984 | } |