aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
authorHenrique de Moraes Holschuh <hmh@hmh.eng.br>2009-01-11 00:01:04 -0500
committerLen Brown <len.brown@intel.com>2009-01-15 13:39:35 -0500
commit7646ea88af80a92f2775e17d4283830d7f09ea2d (patch)
tree1d54184b5b6c24333955b912dd5f996e33893cd7 /drivers/platform
parent0045c0aa7d5e787f78938e6a10927b8a516f0b83 (diff)
ACPI: thinkpad-acpi: use killable instead of interruptible mutexes
Unfortunately, POSIX in all of its braindamage, do not state that userspace has to deal with EINTR in read/write and friends... so, lesser code just doesn't. Switch from *_interruptible to *_killable on the sysfs- and procfs-related mutexes. This closes this possible can of worms. Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/thinkpad_acpi.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index c1d40410ad79..7670c8ee63d1 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -1878,7 +1878,7 @@ static ssize_t hotkey_mask_show(struct device *dev,
1878{ 1878{
1879 int res; 1879 int res;
1880 1880
1881 if (mutex_lock_interruptible(&hotkey_mutex)) 1881 if (mutex_lock_killable(&hotkey_mutex))
1882 return -ERESTARTSYS; 1882 return -ERESTARTSYS;
1883 res = hotkey_mask_get(); 1883 res = hotkey_mask_get();
1884 mutex_unlock(&hotkey_mutex); 1884 mutex_unlock(&hotkey_mutex);
@@ -1897,7 +1897,7 @@ static ssize_t hotkey_mask_store(struct device *dev,
1897 if (parse_strtoul(buf, 0xffffffffUL, &t)) 1897 if (parse_strtoul(buf, 0xffffffffUL, &t))
1898 return -EINVAL; 1898 return -EINVAL;
1899 1899
1900 if (mutex_lock_interruptible(&hotkey_mutex)) 1900 if (mutex_lock_killable(&hotkey_mutex))
1901 return -ERESTARTSYS; 1901 return -ERESTARTSYS;
1902 1902
1903 res = hotkey_mask_set(t); 1903 res = hotkey_mask_set(t);
@@ -1983,7 +1983,7 @@ static ssize_t hotkey_source_mask_store(struct device *dev,
1983 ((t & ~TPACPI_HKEY_NVRAM_KNOWN_MASK) != 0)) 1983 ((t & ~TPACPI_HKEY_NVRAM_KNOWN_MASK) != 0))
1984 return -EINVAL; 1984 return -EINVAL;
1985 1985
1986 if (mutex_lock_interruptible(&hotkey_mutex)) 1986 if (mutex_lock_killable(&hotkey_mutex))
1987 return -ERESTARTSYS; 1987 return -ERESTARTSYS;
1988 1988
1989 HOTKEY_CONFIG_CRITICAL_START 1989 HOTKEY_CONFIG_CRITICAL_START
@@ -2018,7 +2018,7 @@ static ssize_t hotkey_poll_freq_store(struct device *dev,
2018 if (parse_strtoul(buf, 25, &t)) 2018 if (parse_strtoul(buf, 25, &t))
2019 return -EINVAL; 2019 return -EINVAL;
2020 2020
2021 if (mutex_lock_interruptible(&hotkey_mutex)) 2021 if (mutex_lock_killable(&hotkey_mutex))
2022 return -ERESTARTSYS; 2022 return -ERESTARTSYS;
2023 2023
2024 hotkey_poll_freq = t; 2024 hotkey_poll_freq = t;
@@ -2754,7 +2754,7 @@ static int hotkey_read(char *p)
2754 return len; 2754 return len;
2755 } 2755 }
2756 2756
2757 if (mutex_lock_interruptible(&hotkey_mutex)) 2757 if (mutex_lock_killable(&hotkey_mutex))
2758 return -ERESTARTSYS; 2758 return -ERESTARTSYS;
2759 res = hotkey_status_get(&status); 2759 res = hotkey_status_get(&status);
2760 if (!res) 2760 if (!res)
@@ -2785,7 +2785,7 @@ static int hotkey_write(char *buf)
2785 if (!tp_features.hotkey) 2785 if (!tp_features.hotkey)
2786 return -ENODEV; 2786 return -ENODEV;
2787 2787
2788 if (mutex_lock_interruptible(&hotkey_mutex)) 2788 if (mutex_lock_killable(&hotkey_mutex))
2789 return -ERESTARTSYS; 2789 return -ERESTARTSYS;
2790 2790
2791 status = -1; 2791 status = -1;
@@ -5311,7 +5311,7 @@ static int brightness_set(int value)
5311 value < 0) 5311 value < 0)
5312 return -EINVAL; 5312 return -EINVAL;
5313 5313
5314 res = mutex_lock_interruptible(&brightness_mutex); 5314 res = mutex_lock_killable(&brightness_mutex);
5315 if (res < 0) 5315 if (res < 0)
5316 return res; 5316 return res;
5317 5317
@@ -5849,7 +5849,7 @@ static int fan_get_status_safe(u8 *status)
5849 int rc; 5849 int rc;
5850 u8 s; 5850 u8 s;
5851 5851
5852 if (mutex_lock_interruptible(&fan_mutex)) 5852 if (mutex_lock_killable(&fan_mutex))
5853 return -ERESTARTSYS; 5853 return -ERESTARTSYS;
5854 rc = fan_get_status(&s); 5854 rc = fan_get_status(&s);
5855 if (!rc) 5855 if (!rc)
@@ -5932,7 +5932,7 @@ static int fan_set_level_safe(int level)
5932 if (!fan_control_allowed) 5932 if (!fan_control_allowed)
5933 return -EPERM; 5933 return -EPERM;
5934 5934
5935 if (mutex_lock_interruptible(&fan_mutex)) 5935 if (mutex_lock_killable(&fan_mutex))
5936 return -ERESTARTSYS; 5936 return -ERESTARTSYS;
5937 5937
5938 if (level == TPACPI_FAN_LAST_LEVEL) 5938 if (level == TPACPI_FAN_LAST_LEVEL)
@@ -5954,7 +5954,7 @@ static int fan_set_enable(void)
5954 if (!fan_control_allowed) 5954 if (!fan_control_allowed)
5955 return -EPERM; 5955 return -EPERM;
5956 5956
5957 if (mutex_lock_interruptible(&fan_mutex)) 5957 if (mutex_lock_killable(&fan_mutex))
5958 return -ERESTARTSYS; 5958 return -ERESTARTSYS;
5959 5959
5960 switch (fan_control_access_mode) { 5960 switch (fan_control_access_mode) {
@@ -6009,7 +6009,7 @@ static int fan_set_disable(void)
6009 if (!fan_control_allowed) 6009 if (!fan_control_allowed)
6010 return -EPERM; 6010 return -EPERM;
6011 6011
6012 if (mutex_lock_interruptible(&fan_mutex)) 6012 if (mutex_lock_killable(&fan_mutex))
6013 return -ERESTARTSYS; 6013 return -ERESTARTSYS;
6014 6014
6015 rc = 0; 6015 rc = 0;
@@ -6047,7 +6047,7 @@ static int fan_set_speed(int speed)
6047 if (!fan_control_allowed) 6047 if (!fan_control_allowed)
6048 return -EPERM; 6048 return -EPERM;
6049 6049
6050 if (mutex_lock_interruptible(&fan_mutex)) 6050 if (mutex_lock_killable(&fan_mutex))
6051 return -ERESTARTSYS; 6051 return -ERESTARTSYS;
6052 6052
6053 rc = 0; 6053 rc = 0;
@@ -6249,7 +6249,7 @@ static ssize_t fan_pwm1_store(struct device *dev,
6249 /* scale down from 0-255 to 0-7 */ 6249 /* scale down from 0-255 to 0-7 */
6250 newlevel = (s >> 5) & 0x07; 6250 newlevel = (s >> 5) & 0x07;
6251 6251
6252 if (mutex_lock_interruptible(&fan_mutex)) 6252 if (mutex_lock_killable(&fan_mutex))
6253 return -ERESTARTSYS; 6253 return -ERESTARTSYS;
6254 6254
6255 rc = fan_get_status(&status); 6255 rc = fan_get_status(&status);