Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 154200
b: refs/heads/master
c: d9b9bd7
h: refs/heads/master
v: v3
  • Loading branch information
Bjorn Helgaas authored and Len Brown committed Jun 18, 2009
1 parent 7ad6cf5 commit f32f408
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 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: 352fa202c3320ac4844cd38fa72c7a91d7c4cfea
refs/heads/master: d9b9bd7b4a579ff0340d29c2547b952a920639e6
18 changes: 6 additions & 12 deletions trunk/drivers/platform/x86/eeepc-laptop.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ static struct key_entry eeepc_keymap[] = {
*/
static int eeepc_hotk_add(struct acpi_device *device);
static int eeepc_hotk_remove(struct acpi_device *device, int type);
static void eeepc_hotk_notify(struct acpi_device *device, u32 event);

static const struct acpi_device_id eeepc_device_ids[] = {
{EEEPC_HOTK_HID, 0},
Expand All @@ -191,9 +192,11 @@ static struct acpi_driver eeepc_hotk_driver = {
.name = EEEPC_HOTK_NAME,
.class = EEEPC_HOTK_CLASS,
.ids = eeepc_device_ids,
.flags = ACPI_DRIVER_ALL_NOTIFY_EVENTS,
.ops = {
.add = eeepc_hotk_add,
.remove = eeepc_hotk_remove,
.notify = eeepc_hotk_notify,
},
};

Expand Down Expand Up @@ -569,14 +572,16 @@ static void eeepc_rfkill_notify(acpi_handle handle, u32 event, void *data)
rfkill_force_state(ehotk->eeepc_wlan_rfkill, state);
}

static void eeepc_hotk_notify(acpi_handle handle, u32 event, void *data)
static void eeepc_hotk_notify(struct acpi_device *device, u32 event)
{
static struct key_entry *key;
u16 count;
int brn = -ENODEV;

if (!ehotk)
return;
if (event > ACPI_MAX_SYS_NOTIFY)
return;
if (event >= NOTIFY_BRN_MIN && event <= NOTIFY_BRN_MAX)
brn = notify_brn();
count = ehotk->event_count[event % 128]++;
Expand Down Expand Up @@ -657,7 +662,6 @@ static void eeepc_unregister_rfkill_notifier(char *node)

static int eeepc_hotk_add(struct acpi_device *device)
{
acpi_status status = AE_OK;
int result;

if (!device)
Expand All @@ -675,10 +679,6 @@ static int eeepc_hotk_add(struct acpi_device *device)
result = eeepc_hotk_check();
if (result)
goto ehotk_fail;
status = acpi_install_notify_handler(ehotk->handle, ACPI_SYSTEM_NOTIFY,
eeepc_hotk_notify, ehotk);
if (ACPI_FAILURE(status))
printk(EEEPC_ERR "Error installing notify handler\n");

eeepc_register_rfkill_notifier("\\_SB.PCI0.P0P6");
eeepc_register_rfkill_notifier("\\_SB.PCI0.P0P7");
Expand Down Expand Up @@ -759,14 +759,8 @@ static int eeepc_hotk_add(struct acpi_device *device)

static int eeepc_hotk_remove(struct acpi_device *device, int type)
{
acpi_status status = 0;

if (!device || !acpi_driver_data(device))
return -EINVAL;
status = acpi_remove_notify_handler(ehotk->handle, ACPI_SYSTEM_NOTIFY,
eeepc_hotk_notify);
if (ACPI_FAILURE(status))
printk(EEEPC_ERR "Error removing notify handler\n");

eeepc_unregister_rfkill_notifier("\\_SB.PCI0.P0P6");
eeepc_unregister_rfkill_notifier("\\_SB.PCI0.P0P7");
Expand Down

0 comments on commit f32f408

Please sign in to comment.