From 93f07b9570ad87783bff14b533fc3c3cafaceead Mon Sep 17 00:00:00 2001 From: Lekensteyn Date: Tue, 13 Dec 2011 23:15:18 +0100 Subject: [PATCH] bbswitch: Warn when result type is unknown --- bbswitch.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/bbswitch.c b/bbswitch.c index 7c81901..ec8e84f 100644 --- a/bbswitch.c +++ b/bbswitch.c @@ -104,10 +104,9 @@ static int acpi_call_dsm(acpi_handle handle, const char muid[16], int revid, obj = (union acpi_object *)output.pointer; - if (obj->type == ACPI_TYPE_INTEGER && result) - *result = obj->integer.value; - - if (obj->type == ACPI_TYPE_BUFFER) { + if (obj->type == ACPI_TYPE_INTEGER && result) { + *result = obj->integer.value; + } else if (obj->type == ACPI_TYPE_BUFFER) { if (obj->buffer.length == 4 && result) { *result = 0; *result |= obj->buffer.pointer[0]; @@ -115,6 +114,9 @@ static int acpi_call_dsm(acpi_handle handle, const char muid[16], int revid, *result |= (obj->buffer.pointer[2] << 16); *result |= (obj->buffer.pointer[3] << 24); } + } else { + printk(KERN_WARNING "bbswitch: _DSM call yields an unsupported result" + " type: %X\n", obj->type); } kfree(output.pointer);