summaryrefslogtreecommitdiff
path: root/drivers/acpi/sysfs.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-10-28 01:20:24 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-10-28 01:20:24 +0100
commit5171f4fa744de840c2c20f5b65bd3ee1cd85d0e8 (patch)
tree962c881be0b82b2cb973393d98a8a66153167afd /drivers/acpi/sysfs.c
parent975bcabb05436d8b99214a2293d1d5b9c0b0ca08 (diff)
parentb042453f3892465e8372b95a0f42c0890df03445 (diff)
Merge branch 'acpi-assorted'
* acpi-assorted: ACPI: Add Toshiba NB100 to Vista _OSI blacklist ACPI / osl: remove an unneeded NULL check ACPI / platform: add ACPI ID for a Broadcom GPS chip ACPI: improve acpi_extract_package() utility ACPI / LPSS: fix UART Auto Flow Control ACPI / platform: Add ACPI IDs for Intel SST audio device x86 / ACPI: fix incorrect placement of __initdata tag ACPI / thermal: convert printk(LEVEL...) to pr_<lvl> ACPI / sysfs: make GPE sysfs attributes only accept correct values ACPI / EC: Convert all printk() calls to dynamic debug function ACPI / button: Using input_set_capability() to mark device's event capability ACPI / osl: implement acpi_os_sleep() with msleep()
Diffstat (limited to 'drivers/acpi/sysfs.c')
-rw-r--r--drivers/acpi/sysfs.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/acpi/sysfs.c b/drivers/acpi/sysfs.c
index bb6045c5385b..db5293650f62 100644
--- a/drivers/acpi/sysfs.c
+++ b/drivers/acpi/sysfs.c
@@ -564,6 +564,7 @@ static ssize_t counter_set(struct kobject *kobj,
acpi_event_status status;
acpi_handle handle;
int result = 0;
+ unsigned long tmp;
if (index == num_gpes + ACPI_NUM_FIXED_EVENTS + COUNT_SCI) {
int i;
@@ -596,8 +597,10 @@ static ssize_t counter_set(struct kobject *kobj,
else if (!strcmp(buf, "clear\n") &&
(status & ACPI_EVENT_FLAG_SET))
result = acpi_clear_gpe(handle, index);
+ else if (!kstrtoul(buf, 0, &tmp))
+ all_counters[index].count = tmp;
else
- all_counters[index].count = strtoul(buf, NULL, 0);
+ result = -EINVAL;
} else if (index < num_gpes + ACPI_NUM_FIXED_EVENTS) {
int event = index - num_gpes;
if (!strcmp(buf, "disable\n") &&
@@ -609,8 +612,10 @@ static ssize_t counter_set(struct kobject *kobj,
else if (!strcmp(buf, "clear\n") &&
(status & ACPI_EVENT_FLAG_SET))
result = acpi_clear_event(event);
+ else if (!kstrtoul(buf, 0, &tmp))
+ all_counters[index].count = tmp;
else
- all_counters[index].count = strtoul(buf, NULL, 0);
+ result = -EINVAL;
} else
all_counters[index].count = strtoul(buf, NULL, 0);