Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 177504
b: refs/heads/master
c: 13f7002
h: refs/heads/master
v: v3
  • Loading branch information
Alan Jenkins authored and Len Brown committed Dec 9, 2009
1 parent 9c6f71c commit c2e0e1b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 16 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: dc56ad9b49d20e38bb9745bf3beca84291b21a51
refs/heads/master: 13f70029daa3cd7f9983e4aec82f32939b1a6e6a
34 changes: 19 additions & 15 deletions trunk/drivers/platform/x86/eeepc-laptop.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,26 +289,30 @@ static int read_acpi_int(acpi_handle handle, const char *method, int *val)

static int set_acpi(int cm, int value)
{
if (ehotk->cm_supported & (0x1 << cm)) {
const char *method = cm_setv[cm];
if (method == NULL)
return -ENODEV;
if (write_acpi_int(ehotk->handle, method, value, NULL))
pr_warning("Error writing %s\n", method);
}
const char *method = cm_setv[cm];

if (method == NULL)
return -ENODEV;
if ((ehotk->cm_supported & (0x1 << cm)) == 0)
return -ENODEV;

if (write_acpi_int(ehotk->handle, method, value, NULL))
pr_warning("Error writing %s\n", method);
return 0;
}

static int get_acpi(int cm)
{
int value = -ENODEV;
if ((ehotk->cm_supported & (0x1 << cm))) {
const char *method = cm_getv[cm];
if (method == NULL)
return -ENODEV;
if (read_acpi_int(ehotk->handle, method, &value))
pr_warning("Error reading %s\n", method);
}
const char *method = cm_getv[cm];
int value;

if (method == NULL)
return -ENODEV;
if ((ehotk->cm_supported & (0x1 << cm)) == 0)
return -ENODEV;

if (read_acpi_int(ehotk->handle, method, &value))
pr_warning("Error reading %s\n", method);
return value;
}

Expand Down

0 comments on commit c2e0e1b

Please sign in to comment.