aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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}