aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
authorThadeu Lima de Souza Cascardo <cascardo@holoscopio.com>2010-02-09 17:37:27 -0500
committerMatthew Garrett <mjg@redhat.com>2010-02-25 11:50:52 -0500
commit02e77a55f7b7e36888e39c62439fedb90ae4e808 (patch)
tree98cfa14ab0f099ac24c0a9ddc2a29f7367b79d25 /drivers/platform
parentc6760ac4268b6dbe03d74e5faef35bc862a82542 (diff)
classmate-laptop: use a single MODULE_DEVICE_TABLE to get correct aliases
Instead of a MODULE_DEVICE_TABLE for every acpi_driver ids table, we create a table containing all ids to export to get a module alias for each one. This will fix automatic loading of the driver when one of the ACPI devices is not present (like the accelerometer, which is not present in some models). Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/classmate-laptop.c31
1 files changed, 21 insertions, 10 deletions
diff --git a/drivers/platform/x86/classmate-laptop.c b/drivers/platform/x86/classmate-laptop.c
index ed90082cdf1d..8cb20e45bad6 100644
--- a/drivers/platform/x86/classmate-laptop.c
+++ b/drivers/platform/x86/classmate-laptop.c
@@ -34,6 +34,11 @@ struct cmpc_accel {
34#define CMPC_ACCEL_SENSITIVITY_DEFAULT 5 34#define CMPC_ACCEL_SENSITIVITY_DEFAULT 5
35 35
36 36
37#define CMPC_ACCEL_HID "ACCE0000"
38#define CMPC_TABLET_HID "TBLT0000"
39#define CMPC_BL_HID "IPML200"
40#define CMPC_KEYS_HID "FnBT0000"
41
37/* 42/*
38 * Generic input device code. 43 * Generic input device code.
39 */ 44 */
@@ -282,10 +287,9 @@ static int cmpc_accel_remove(struct acpi_device *acpi, int type)
282} 287}
283 288
284static const struct acpi_device_id cmpc_accel_device_ids[] = { 289static const struct acpi_device_id cmpc_accel_device_ids[] = {
285 {"ACCE0000", 0}, 290 {CMPC_ACCEL_HID, 0},
286 {"", 0} 291 {"", 0}
287}; 292};
288MODULE_DEVICE_TABLE(acpi, cmpc_accel_device_ids);
289 293
290static struct acpi_driver cmpc_accel_acpi_driver = { 294static struct acpi_driver cmpc_accel_acpi_driver = {
291 .owner = THIS_MODULE, 295 .owner = THIS_MODULE,
@@ -366,10 +370,9 @@ static int cmpc_tablet_resume(struct acpi_device *acpi)
366} 370}
367 371
368static const struct acpi_device_id cmpc_tablet_device_ids[] = { 372static const struct acpi_device_id cmpc_tablet_device_ids[] = {
369 {"TBLT0000", 0}, 373 {CMPC_TABLET_HID, 0},
370 {"", 0} 374 {"", 0}
371}; 375};
372MODULE_DEVICE_TABLE(acpi, cmpc_tablet_device_ids);
373 376
374static struct acpi_driver cmpc_tablet_acpi_driver = { 377static struct acpi_driver cmpc_tablet_acpi_driver = {
375 .owner = THIS_MODULE, 378 .owner = THIS_MODULE,
@@ -477,17 +480,16 @@ static int cmpc_bl_remove(struct acpi_device *acpi, int type)
477 return 0; 480 return 0;
478} 481}
479 482
480static const struct acpi_device_id cmpc_device_ids[] = { 483static const struct acpi_device_id cmpc_bl_device_ids[] = {
481 {"IPML200", 0}, 484 {CMPC_BL_HID, 0},
482 {"", 0} 485 {"", 0}
483}; 486};
484MODULE_DEVICE_TABLE(acpi, cmpc_device_ids);
485 487
486static struct acpi_driver cmpc_bl_acpi_driver = { 488static struct acpi_driver cmpc_bl_acpi_driver = {
487 .owner = THIS_MODULE, 489 .owner = THIS_MODULE,
488 .name = "cmpc", 490 .name = "cmpc",
489 .class = "cmpc", 491 .class = "cmpc",
490 .ids = cmpc_device_ids, 492 .ids = cmpc_bl_device_ids,
491 .ops = { 493 .ops = {
492 .add = cmpc_bl_add, 494 .add = cmpc_bl_add,
493 .remove = cmpc_bl_remove 495 .remove = cmpc_bl_remove
@@ -540,10 +542,9 @@ static int cmpc_keys_remove(struct acpi_device *acpi, int type)
540} 542}
541 543
542static const struct acpi_device_id cmpc_keys_device_ids[] = { 544static const struct acpi_device_id cmpc_keys_device_ids[] = {
543 {"FnBT0000", 0}, 545 {CMPC_KEYS_HID, 0},
544 {"", 0} 546 {"", 0}
545}; 547};
546MODULE_DEVICE_TABLE(acpi, cmpc_keys_device_ids);
547 548
548static struct acpi_driver cmpc_keys_acpi_driver = { 549static struct acpi_driver cmpc_keys_acpi_driver = {
549 .owner = THIS_MODULE, 550 .owner = THIS_MODULE,
@@ -607,3 +608,13 @@ static void cmpc_exit(void)
607 608
608module_init(cmpc_init); 609module_init(cmpc_init);
609module_exit(cmpc_exit); 610module_exit(cmpc_exit);
611
612static const struct acpi_device_id cmpc_device_ids[] = {
613 {CMPC_ACCEL_HID, 0},
614 {CMPC_TABLET_HID, 0},
615 {CMPC_BL_HID, 0},
616 {CMPC_KEYS_HID, 0},
617 {"", 0}
618};
619
620MODULE_DEVICE_TABLE(acpi, cmpc_device_ids);