Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 310152
b: refs/heads/master
c: 9e12337
h: refs/heads/master
v: v3
  • Loading branch information
Mattia Dongili authored and Matthew Garrett committed May 31, 2012
1 parent 8853a4b commit 65bc153
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ebcef1b0e41f2ff972e5c5487a30e8f4ee2b6f13
refs/heads/master: 9e1233792933bc9b64133c3b00f2f4ef8b02d1a2
26 changes: 17 additions & 9 deletions trunk/drivers/platform/x86/sony-laptop.c
Original file line number Diff line number Diff line change
Expand Up @@ -944,7 +944,8 @@ static ssize_t sony_nc_sysfs_store(struct device *dev,
struct device_attribute *attr,
const char *buffer, size_t count)
{
int value, ret = 0;
unsigned long value = 0;
int ret = 0;
struct sony_nc_value *item =
container_of(attr, struct sony_nc_value, devattr);

Expand All @@ -954,16 +955,17 @@ static ssize_t sony_nc_sysfs_store(struct device *dev,
if (count > 31)
return -EINVAL;

value = simple_strtoul(buffer, NULL, 10);
if (kstrtoul(buffer, 10, &value))
return -EINVAL;

if (item->validate)
value = item->validate(SNC_VALIDATE_IN, value);

if (value < 0)
return value;

ret = sony_nc_int_call(sony_nc_acpi_handle, *item->acpiset, &value,
NULL);
ret = sony_nc_int_call(sony_nc_acpi_handle, *item->acpiset,
(int *)&value, NULL);
if (ret < 0)
return -EIO;

Expand Down Expand Up @@ -1445,7 +1447,7 @@ static ssize_t sony_nc_kbd_backlight_mode_store(struct device *dev,
if (count > 31)
return -EINVAL;

if (strict_strtoul(buffer, 10, &value))
if (kstrtoul(buffer, 10, &value))
return -EINVAL;

ret = __sony_nc_kbd_backlight_mode_set(value);
Expand Down Expand Up @@ -1489,7 +1491,7 @@ static ssize_t sony_nc_kbd_backlight_timeout_store(struct device *dev,
if (count > 31)
return -EINVAL;

if (strict_strtoul(buffer, 10, &value))
if (kstrtoul(buffer, 10, &value))
return -EINVAL;

ret = __sony_nc_kbd_backlight_timeout_set(value);
Expand Down Expand Up @@ -2439,7 +2441,9 @@ static ssize_t sony_pic_wwanpower_store(struct device *dev,
if (count > 31)
return -EINVAL;

value = simple_strtoul(buffer, NULL, 10);
if (kstrtoul(buffer, 10, &value))
return -EINVAL;

mutex_lock(&spic_dev.lock);
__sony_pic_set_wwanpower(value);
mutex_unlock(&spic_dev.lock);
Expand Down Expand Up @@ -2476,7 +2480,9 @@ static ssize_t sony_pic_bluetoothpower_store(struct device *dev,
if (count > 31)
return -EINVAL;

value = simple_strtoul(buffer, NULL, 10);
if (kstrtoul(buffer, 10, &value))
return -EINVAL;

mutex_lock(&spic_dev.lock);
__sony_pic_set_bluetoothpower(value);
mutex_unlock(&spic_dev.lock);
Expand Down Expand Up @@ -2515,7 +2521,9 @@ static ssize_t sony_pic_fanspeed_store(struct device *dev,
if (count > 31)
return -EINVAL;

value = simple_strtoul(buffer, NULL, 10);
if (kstrtoul(buffer, 10, &value))
return -EINVAL;

if (sony_pic_set_fanspeed(value))
return -EIO;

Expand Down

0 comments on commit 65bc153

Please sign in to comment.