aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMattia Dongili <malattia@linux.it>2009-03-26 21:58:23 +0900
committerLen Brown <len.brown@intel.com>2009-03-27 12:20:02 -0400
commitc9f1e6f67ad6d16c11586a4550fd054d7538eb92 (patch)
treea57a49556d2722c500b57558628fa7557fcd4213
parentf5acf5e898618295895b61d81681ae3115d94b96 (diff)
sony-laptop: Make sony_pic_set_wwanpower not take mutexes
For consistency with __sony_pic_set_bluetoothpower, this is also needed later to allow setting the wwanpower attribute from the resume path and only lock the mutex once. Signed-off-by: Mattia Dongili <malattia@linux.it> Signed-off-by: Len Brown <len.brown@intel.com>
-rw-r--r--drivers/platform/x86/sony-laptop.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c
index 3575a2d8f1c..8796dc69950 100644
--- a/drivers/platform/x86/sony-laptop.c
+++ b/drivers/platform/x86/sony-laptop.c
@@ -2001,18 +2001,14 @@ int sony_pic_camera_command(int command, u8 value)
EXPORT_SYMBOL(sony_pic_camera_command);
/* gprs/edge modem (SZ460N and SZ210P), thanks to Joshua Wise */
-static void sony_pic_set_wwanpower(u8 state)
+static void __sony_pic_set_wwanpower(u8 state)
{
state = !!state;
- mutex_lock(&spic_dev.lock);
- if (spic_dev.wwan_power == state) {
- mutex_unlock(&spic_dev.lock);
+ if (spic_dev.wwan_power == state)
return;
- }
sony_pic_call2(0xB0, state);
sony_pic_call1(0x82);
spic_dev.wwan_power = state;
- mutex_unlock(&spic_dev.lock);
}
static ssize_t sony_pic_wwanpower_store(struct device *dev,
@@ -2024,7 +2020,9 @@ static ssize_t sony_pic_wwanpower_store(struct device *dev,
return -EINVAL;
value = simple_strtoul(buffer, NULL, 10);
- sony_pic_set_wwanpower(value);
+ mutex_lock(&spic_dev.lock);
+ __sony_pic_set_wwanpower(value);
+ mutex_unlock(&spic_dev.lock);
return count;
}