Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 243134
b: refs/heads/master
c: 8215af0
h: refs/heads/master
v: v3
  • Loading branch information
Lee, Chun-Yi authored and Matthew Garrett committed Mar 28, 2011
1 parent 4d5df5c commit f985369
Show file tree
Hide file tree
Showing 2 changed files with 15 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: c8440336fe376036e473554c30f7266987961734
refs/heads/master: 8215af019040ce9182728afee9642d8fdeb17f59
19 changes: 14 additions & 5 deletions trunk/drivers/platform/x86/acer-wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ struct acer_debug {
static struct rfkill *wireless_rfkill;
static struct rfkill *bluetooth_rfkill;
static struct rfkill *threeg_rfkill;
static bool rfkill_inited;

/* Each low-level interface must define at least some of the following */
struct wmi_interface {
Expand Down Expand Up @@ -1157,9 +1158,13 @@ static int acer_rfkill_set(void *data, bool blocked)
{
acpi_status status;
u32 cap = (unsigned long)data;
status = set_u32(!blocked, cap);
if (ACPI_FAILURE(status))
return -ENODEV;

if (rfkill_inited) {
status = set_u32(!blocked, cap);
if (ACPI_FAILURE(status))
return -ENODEV;
}

return 0;
}

Expand All @@ -1183,14 +1188,16 @@ static struct rfkill *acer_rfkill_register(struct device *dev,
return ERR_PTR(-ENOMEM);

status = get_device_status(&state, cap);
if (ACPI_SUCCESS(status))
rfkill_init_sw_state(rfkill_dev, !state);

err = rfkill_register(rfkill_dev);
if (err) {
rfkill_destroy(rfkill_dev);
return ERR_PTR(err);
}

if (ACPI_SUCCESS(status))
rfkill_set_sw_state(rfkill_dev, !state);

return rfkill_dev;
}

Expand Down Expand Up @@ -1225,6 +1232,8 @@ static int acer_rfkill_init(struct device *dev)
}
}

rfkill_inited = true;

schedule_delayed_work(&acer_rfkill_work, round_jiffies_relative(HZ));

return 0;
Expand Down

0 comments on commit f985369

Please sign in to comment.