aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
authorMattia Dongili <malattia@linux.it>2009-03-26 08:58:23 -0400
committerLen Brown <len.brown@intel.com>2009-03-27 12:20:02 -0400
commitc9f1e6f67ad6d16c11586a4550fd054d7538eb92 (patch)
treea57a49556d2722c500b57558628fa7557fcd4213 /drivers/platform
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>
Diffstat (limited to 'drivers/platform')
-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 3575a2d8f1ce..8796dc69950e 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)
2001EXPORT_SYMBOL(sony_pic_camera_command); 2001EXPORT_SYMBOL(sony_pic_camera_command);
2002 2002
2003/* gprs/edge modem (SZ460N and SZ210P), thanks to Joshua Wise */ 2003/* gprs/edge modem (SZ460N and SZ210P), thanks to Joshua Wise */
2004static void sony_pic_set_wwanpower(u8 state) 2004static void __sony_pic_set_wwanpower(u8 state)
2005{ 2005{
2006 state = !!state; 2006 state = !!state;
2007 mutex_lock(&spic_dev.lock); 2007 if (spic_dev.wwan_power == state)
2008 if (spic_dev.wwan_power == state) {
2009 mutex_unlock(&spic_dev.lock);
2010 return; 2008 return;
2011 }
2012 sony_pic_call2(0xB0, state); 2009 sony_pic_call2(0xB0, state);
2013 sony_pic_call1(0x82); 2010 sony_pic_call1(0x82);
2014 spic_dev.wwan_power = state; 2011 spic_dev.wwan_power = state;
2015 mutex_unlock(&spic_dev.lock);
2016} 2012}
2017 2013
2018static ssize_t sony_pic_wwanpower_store(struct device *dev, 2014static ssize_t sony_pic_wwanpower_store(struct device *dev,
@@ -2024,7 +2020,9 @@ static ssize_t sony_pic_wwanpower_store(struct device *dev,
2024 return -EINVAL; 2020 return -EINVAL;
2025 2021
2026 value = simple_strtoul(buffer, NULL, 10); 2022 value = simple_strtoul(buffer, NULL, 10);
2027 sony_pic_set_wwanpower(value); 2023 mutex_lock(&spic_dev.lock);
2024 __sony_pic_set_wwanpower(value);
2025 mutex_unlock(&spic_dev.lock);
2028 2026
2029 return count; 2027 return count;
2030} 2028}