Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 178636
b: refs/heads/master
c: ead510c
h: refs/heads/master
v: v3
  • Loading branch information
Henrique de Moraes Holschuh authored and Len Brown committed Dec 27, 2009
1 parent 6134f3f commit 7d16e94
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 62 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: 1ae22af7d750fbf665b7651fcbd3c15cc2d3793b
refs/heads/master: ead510cebcdf41c92fce2a909f342255b028a33d
4 changes: 2 additions & 2 deletions trunk/drivers/char/ipmi/ipmi_si_intf.c
Original file line number Diff line number Diff line change
Expand Up @@ -3204,7 +3204,7 @@ static __devinit int init_ipmi_si(void)
#ifdef CONFIG_ACPI
spmi_find_bmc();
#endif
#ifdef CONFIG_ACPI
#ifdef CONFIG_PNP
pnp_register_driver(&ipmi_pnp_driver);
#endif

Expand Down Expand Up @@ -3330,7 +3330,7 @@ static __exit void cleanup_ipmi_si(void)
#ifdef CONFIG_PCI
pci_unregister_driver(&ipmi_pci_driver);
#endif
#ifdef CONFIG_ACPI
#ifdef CONFIG_PNP
pnp_unregister_driver(&ipmi_pnp_driver);
#endif

Expand Down
18 changes: 6 additions & 12 deletions trunk/drivers/platform/x86/dell-wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,13 +202,8 @@ static void dell_wmi_notify(u32 value, void *context)
struct acpi_buffer response = { ACPI_ALLOCATE_BUFFER, NULL };
static struct key_entry *key;
union acpi_object *obj;
acpi_status status;

status = wmi_get_event_data(value, &response);
if (status != AE_OK) {
printk(KERN_INFO "dell-wmi: bad event status 0x%x\n", status);
return;
}
wmi_get_event_data(value, &response);

obj = (union acpi_object *)response.pointer;

Expand Down Expand Up @@ -328,9 +323,8 @@ static int __init dell_wmi_input_setup(void)
static int __init dell_wmi_init(void)
{
int err;
acpi_status status;

if (!wmi_has_guid(DELL_EVENT_GUID)) {
if (wmi_has_guid(DELL_EVENT_GUID)) {
printk(KERN_WARNING "dell-wmi: No known WMI GUID found\n");
return -ENODEV;
}
Expand All @@ -342,14 +336,14 @@ static int __init dell_wmi_init(void)
if (err)
return err;

status = wmi_install_notify_handler(DELL_EVENT_GUID,
err = wmi_install_notify_handler(DELL_EVENT_GUID,
dell_wmi_notify, NULL);
if (ACPI_FAILURE(status)) {
if (err) {
input_unregister_device(dell_wmi_input_dev);
printk(KERN_ERR
"dell-wmi: Unable to register notify handler - %d\n",
status);
return -ENODEV;
err);
return err;
}

return 0;
Expand Down
9 changes: 2 additions & 7 deletions trunk/drivers/platform/x86/hp-wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,13 +338,8 @@ static void hp_wmi_notify(u32 value, void *context)
static struct key_entry *key;
union acpi_object *obj;
int eventcode;
acpi_status status;

status = wmi_get_event_data(value, &response);
if (status != AE_OK) {
printk(KERN_INFO "hp-wmi: bad event status 0x%x\n", status);
return;
}
wmi_get_event_data(value, &response);

obj = (union acpi_object *)response.pointer;

Expand Down Expand Up @@ -586,7 +581,7 @@ static int __init hp_wmi_init(void)
if (wmi_has_guid(HPWMI_EVENT_GUID)) {
err = wmi_install_notify_handler(HPWMI_EVENT_GUID,
hp_wmi_notify, NULL);
if (ACPI_SUCCESS(err))
if (!err)
hp_wmi_input_setup();
}

Expand Down
9 changes: 2 additions & 7 deletions trunk/drivers/platform/x86/msi-wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,8 @@ static void msi_wmi_notify(u32 value, void *context)
static struct key_entry *key;
union acpi_object *obj;
ktime_t cur;
acpi_status status;

status = wmi_get_event_data(value, &response);
if (status != AE_OK) {
printk(KERN_INFO DRV_PFX "bad event status 0x%x\n", status);
return;
}
wmi_get_event_data(value, &response);

obj = (union acpi_object *)response.pointer;

Expand Down Expand Up @@ -241,7 +236,7 @@ static int __init msi_wmi_init(void)
}
err = wmi_install_notify_handler(MSIWMI_EVENT_GUID,
msi_wmi_notify, NULL);
if (ACPI_FAILURE(err))
if (err)
return -EINVAL;

err = msi_wmi_input_setup();
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/platform/x86/thinkpad_acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -6388,7 +6388,7 @@ static struct ibm_struct brightness_driver_data = {
#define TPACPI_ALSA_SHRTNAME "ThinkPad Console Audio Control"
#define TPACPI_ALSA_MIXERNAME TPACPI_ALSA_SHRTNAME

static int alsa_index = SNDRV_DEFAULT_IDX1;
static int alsa_index = ~((1 << (SNDRV_CARDS - 3)) - 1); /* last three slots */
static char *alsa_id = "ThinkPadEC";
static int alsa_enable = SNDRV_DEFAULT_ENABLE1;

Expand Down
36 changes: 4 additions & 32 deletions trunk/drivers/platform/x86/wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,8 @@ wmi_notify_handler handler, void *data)
if (!guid || !handler)
return AE_BAD_PARAMETER;

if (!find_guid(guid, &block))
find_guid(guid, &block);
if (!block)
return AE_NOT_EXIST;

if (block->handler)
Expand Down Expand Up @@ -520,7 +521,8 @@ acpi_status wmi_remove_notify_handler(const char *guid)
if (!guid)
return AE_BAD_PARAMETER;

if (!find_guid(guid, &block))
find_guid(guid, &block);
if (!block)
return AE_NOT_EXIST;

if (!block->handler)
Expand Down Expand Up @@ -714,22 +716,6 @@ static int wmi_class_init(void)
return ret;
}

static bool guid_already_parsed(const char *guid_string)
{
struct guid_block *gblock;
struct wmi_block *wblock;
struct list_head *p;

list_for_each(p, &wmi_blocks.list) {
wblock = list_entry(p, struct wmi_block, list);
gblock = &wblock->gblock;

if (strncmp(gblock->guid, guid_string, 16) == 0)
return true;
}
return false;
}

/*
* Parse the _WDG method for the GUID data blocks
*/
Expand All @@ -739,7 +725,6 @@ static __init acpi_status parse_wdg(acpi_handle handle)
union acpi_object *obj;
struct guid_block *gblock;
struct wmi_block *wblock;
char guid_string[37];
acpi_status status;
u32 i, total;

Expand All @@ -762,19 +747,6 @@ static __init acpi_status parse_wdg(acpi_handle handle)
memcpy(gblock, obj->buffer.pointer, obj->buffer.length);

for (i = 0; i < total; i++) {
/*
Some WMI devices, like those for nVidia hooks, have a
duplicate GUID. It's not clear what we should do in this
case yet, so for now, we'll just ignore the duplicate.
Anyone who wants to add support for that device can come
up with a better workaround for the mess then.
*/
if (guid_already_parsed(gblock[i].guid) == true) {
wmi_gtoa(gblock[i].guid, guid_string);
printk(KERN_INFO PREFIX "Skipping duplicate GUID %s\n",
guid_string);
continue;
}
wblock = kzalloc(sizeof(struct wmi_block), GFP_KERNEL);
if (!wblock)
return AE_NO_MEMORY;
Expand Down

0 comments on commit 7d16e94

Please sign in to comment.