aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2009-04-05 01:52:07 -0400
committerLen Brown <len.brown@intel.com>2009-04-05 01:52:07 -0400
commit8a3f257c704e02aee9869decd069a806b45be3f1 (patch)
treeadb9d3766c57119381304c3b94334997cc7a74a7 /drivers/platform
parent33526a53600ac887d100e3c9b4be3637ac8ae3a5 (diff)
parent15065531c1c5902775ae3ade24eb37d0e688353b (diff)
Merge branch 'misc' into release
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/panasonic-laptop.c9
-rw-r--r--drivers/platform/x86/tc1100-wmi.c7
2 files changed, 8 insertions, 8 deletions
diff --git a/drivers/platform/x86/panasonic-laptop.c b/drivers/platform/x86/panasonic-laptop.c
index c47a44dcb702..a5ce4bc202e3 100644
--- a/drivers/platform/x86/panasonic-laptop.c
+++ b/drivers/platform/x86/panasonic-laptop.c
@@ -184,6 +184,7 @@ static const struct acpi_device_id pcc_device_ids[] = {
184 { "MAT0019", 0}, 184 { "MAT0019", 0},
185 { "", 0}, 185 { "", 0},
186}; 186};
187MODULE_DEVICE_TABLE(acpi, pcc_device_ids);
187 188
188static struct acpi_driver acpi_pcc_driver = { 189static struct acpi_driver acpi_pcc_driver = {
189 .name = ACPI_PCC_DRIVER_NAME, 190 .name = ACPI_PCC_DRIVER_NAME,
@@ -366,7 +367,7 @@ static ssize_t show_numbatt(struct device *dev, struct device_attribute *attr,
366 if (!acpi_pcc_retrieve_biosdata(pcc, pcc->sinf)) 367 if (!acpi_pcc_retrieve_biosdata(pcc, pcc->sinf))
367 return -EIO; 368 return -EIO;
368 369
369 return sprintf(buf, "%u\n", pcc->sinf[SINF_NUM_BATTERIES]); 370 return snprintf(buf, PAGE_SIZE, "%u\n", pcc->sinf[SINF_NUM_BATTERIES]);
370} 371}
371 372
372static ssize_t show_lcdtype(struct device *dev, struct device_attribute *attr, 373static ssize_t show_lcdtype(struct device *dev, struct device_attribute *attr,
@@ -378,7 +379,7 @@ static ssize_t show_lcdtype(struct device *dev, struct device_attribute *attr,
378 if (!acpi_pcc_retrieve_biosdata(pcc, pcc->sinf)) 379 if (!acpi_pcc_retrieve_biosdata(pcc, pcc->sinf))
379 return -EIO; 380 return -EIO;
380 381
381 return sprintf(buf, "%u\n", pcc->sinf[SINF_LCD_TYPE]); 382 return snprintf(buf, PAGE_SIZE, "%u\n", pcc->sinf[SINF_LCD_TYPE]);
382} 383}
383 384
384static ssize_t show_mute(struct device *dev, struct device_attribute *attr, 385static ssize_t show_mute(struct device *dev, struct device_attribute *attr,
@@ -390,7 +391,7 @@ static ssize_t show_mute(struct device *dev, struct device_attribute *attr,
390 if (!acpi_pcc_retrieve_biosdata(pcc, pcc->sinf)) 391 if (!acpi_pcc_retrieve_biosdata(pcc, pcc->sinf))
391 return -EIO; 392 return -EIO;
392 393
393 return sprintf(buf, "%u\n", pcc->sinf[SINF_MUTE]); 394 return snprintf(buf, PAGE_SIZE, "%u\n", pcc->sinf[SINF_MUTE]);
394} 395}
395 396
396static ssize_t show_sticky(struct device *dev, struct device_attribute *attr, 397static ssize_t show_sticky(struct device *dev, struct device_attribute *attr,
@@ -402,7 +403,7 @@ static ssize_t show_sticky(struct device *dev, struct device_attribute *attr,
402 if (!acpi_pcc_retrieve_biosdata(pcc, pcc->sinf)) 403 if (!acpi_pcc_retrieve_biosdata(pcc, pcc->sinf))
403 return -EIO; 404 return -EIO;
404 405
405 return sprintf(buf, "%u\n", pcc->sinf[SINF_STICKY_KEY]); 406 return snprintf(buf, PAGE_SIZE, "%u\n", pcc->sinf[SINF_STICKY_KEY]);
406} 407}
407 408
408static ssize_t set_sticky(struct device *dev, struct device_attribute *attr, 409static ssize_t set_sticky(struct device *dev, struct device_attribute *attr,
diff --git a/drivers/platform/x86/tc1100-wmi.c b/drivers/platform/x86/tc1100-wmi.c
index b4a4aa9ee482..44166003d4ef 100644
--- a/drivers/platform/x86/tc1100-wmi.c
+++ b/drivers/platform/x86/tc1100-wmi.c
@@ -94,9 +94,8 @@ static int get_state(u32 *out, u8 instance)
94 return -ENODEV; 94 return -ENODEV;
95 95
96 obj = (union acpi_object *) result.pointer; 96 obj = (union acpi_object *) result.pointer;
97 if (obj && obj->type == ACPI_TYPE_BUFFER && 97 if (obj && obj->type == ACPI_TYPE_INTEGER) {
98 obj->buffer.length == sizeof(u32)) { 98 tmp = obj->integer.value;
99 tmp = *((u32 *) obj->buffer.pointer);
100 } else { 99 } else {
101 tmp = 0; 100 tmp = 0;
102 } 101 }
@@ -109,7 +108,7 @@ static int get_state(u32 *out, u8 instance)
109 *out = (tmp == 3) ? 1 : 0; 108 *out = (tmp == 3) ? 1 : 0;
110 return 0; 109 return 0;
111 case TC1100_INSTANCE_JOGDIAL: 110 case TC1100_INSTANCE_JOGDIAL:
112 *out = (tmp == 1) ? 1 : 0; 111 *out = (tmp == 1) ? 0 : 1;
113 return 0; 112 return 0;
114 default: 113 default:
115 return -ENODEV; 114 return -ENODEV;