Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 154383
b: refs/heads/master
c: f36509e
h: refs/heads/master
i:
  154381: 440fa49
  154379: 95bf0a5
  154375: 5a6dd7a
  154367: 07a4023
v: v3
  • Loading branch information
Corentin Chary authored and Len Brown committed Jun 26, 2009
1 parent 9ec34fd commit ec7ee99
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 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: 1ddec2f9435e77b4d3f50eced68c4c942f2bcd4b
refs/heads/master: f36509e7248631671d02f48d1a88f56cdeb54ed8
17 changes: 12 additions & 5 deletions trunk/drivers/platform/x86/eeepc-laptop.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ static int set_acpi(int cm, int value)

static int get_acpi(int cm)
{
int value = -1;
int value = -ENODEV;
if ((ehotk->cm_supported & (0x1 << cm))) {
const char *method = cm_getv[cm];
if (method == NULL)
Expand Down Expand Up @@ -367,13 +367,19 @@ static ssize_t store_sys_acpi(int cm, const char *buf, size_t count)

rv = parse_arg(buf, count, &value);
if (rv > 0)
set_acpi(cm, value);
value = set_acpi(cm, value);
if (value < 0)
return value;
return rv;
}

static ssize_t show_sys_acpi(int cm, char *buf)
{
return sprintf(buf, "%d\n", get_acpi(cm));
int value = get_acpi(cm);

if (value < 0)
return value;
return sprintf(buf, "%d\n", value);
}

#define EEEPC_CREATE_DEVICE_ATTR(_name, _cm) \
Expand Down Expand Up @@ -1036,8 +1042,9 @@ static int eeepc_new_rfkill(struct rfkill **rfkill,
{
int result;

if (get_acpi(cm) == -1)
return -ENODEV;
result = get_acpi(cm);
if (result < 0)
return result;

*rfkill = rfkill_alloc(name, dev, type,
&eeepc_rfkill_ops, (void *)(unsigned long)cm);
Expand Down

0 comments on commit ec7ee99

Please sign in to comment.