Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 142843
b: refs/heads/master
c: cddd1f7
h: refs/heads/master
i:
  142841: 5a49d7f
  142839: 90f7c7e
v: v3
  • Loading branch information
Bjorn Helgaas authored and Len Brown committed Apr 7, 2009
1 parent f431bcd commit 47ddbb6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 22 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: b4ec0275464756f4fd4108b4a4ca7aff61358ad3
refs/heads/master: cddd1f71d972a43c88f0ef91e1b71023539cd6e0
26 changes: 5 additions & 21 deletions trunk/drivers/platform/x86/panasonic-laptop.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ enum SINF_BITS { SINF_NUM_BATTERIES = 0,
static int acpi_pcc_hotkey_add(struct acpi_device *device);
static int acpi_pcc_hotkey_remove(struct acpi_device *device, int type);
static int acpi_pcc_hotkey_resume(struct acpi_device *device);
static void acpi_pcc_hotkey_notify(struct acpi_device *device, u32 event);

static const struct acpi_device_id pcc_device_ids[] = {
{ "MAT0012", 0},
Expand All @@ -194,6 +195,7 @@ static struct acpi_driver acpi_pcc_driver = {
.add = acpi_pcc_hotkey_add,
.remove = acpi_pcc_hotkey_remove,
.resume = acpi_pcc_hotkey_resume,
.notify = acpi_pcc_hotkey_notify,
},
};

Expand Down Expand Up @@ -527,9 +529,9 @@ static void acpi_pcc_generate_keyinput(struct pcc_acpi *pcc)
return;
}

static void acpi_pcc_hotkey_notify(acpi_handle handle, u32 event, void *data)
static void acpi_pcc_hotkey_notify(struct acpi_device *device, u32 event)
{
struct pcc_acpi *pcc = (struct pcc_acpi *) data;
struct pcc_acpi *pcc = acpi_driver_data(device);

switch (event) {
case HKEY_NOTIFY:
Expand Down Expand Up @@ -599,7 +601,6 @@ static int acpi_pcc_hotkey_resume(struct acpi_device *device)

static int acpi_pcc_hotkey_add(struct acpi_device *device)
{
acpi_status status;
struct pcc_acpi *pcc;
int num_sifr, result;

Expand Down Expand Up @@ -640,22 +641,11 @@ static int acpi_pcc_hotkey_add(struct acpi_device *device)
goto out_sinf;
}

/* initialize hotkey input device */
status = acpi_install_notify_handler(pcc->handle, ACPI_DEVICE_NOTIFY,
acpi_pcc_hotkey_notify, pcc);

if (ACPI_FAILURE(status)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Error installing notify handler\n"));
result = -ENODEV;
goto out_input;
}

/* initialize backlight */
pcc->backlight = backlight_device_register("panasonic", NULL, pcc,
&pcc_backlight_ops);
if (IS_ERR(pcc->backlight))
goto out_notify;
goto out_input;

if (!acpi_pcc_retrieve_biosdata(pcc, pcc->sinf)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
Expand All @@ -680,9 +670,6 @@ static int acpi_pcc_hotkey_add(struct acpi_device *device)

out_backlight:
backlight_device_unregister(pcc->backlight);
out_notify:
acpi_remove_notify_handler(pcc->handle, ACPI_DEVICE_NOTIFY,
acpi_pcc_hotkey_notify);
out_input:
input_unregister_device(pcc->input_dev);
/* no need to input_free_device() since core input API refcount and
Expand Down Expand Up @@ -723,9 +710,6 @@ static int acpi_pcc_hotkey_remove(struct acpi_device *device, int type)

backlight_device_unregister(pcc->backlight);

acpi_remove_notify_handler(pcc->handle, ACPI_DEVICE_NOTIFY,
acpi_pcc_hotkey_notify);

input_unregister_device(pcc->input_dev);
/* no need to input_free_device() since core input API refcount and
* free()s the device */
Expand Down

0 comments on commit 47ddbb6

Please sign in to comment.