aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc
diff options
context:
space:
mode:
authorPavel Machek <pavel@suse.cz>2008-09-22 17:37:34 -0400
committerLen Brown <len.brown@intel.com>2008-10-10 18:05:53 -0400
commitdb89b4f0dbab837d0f3de2c3e9427a8d5393afa3 (patch)
treee664a0af46cb02d91c699015268d4fa10a6ce190 /drivers/misc
parent9e113e0014204bfb44a2baa29b2a141ede41b074 (diff)
ACPI: catch calls of acpi_driver_data on pointer of wrong type
Catch attempts to use of acpi_driver_data on pointers of wrong type. akpm: rewritten to use proper C typechecking and remove the "function"-used-as-lvalue thing. Signed-off-by: Pavel Machek <pavel@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/asus-laptop.c2
-rw-r--r--drivers/misc/eeepc-laptop.c2
-rw-r--r--drivers/misc/fujitsu-laptop.c4
-rw-r--r--drivers/misc/intel_menlow.c2
-rw-r--r--drivers/misc/thinkpad_acpi.c2
5 files changed, 6 insertions, 6 deletions
diff --git a/drivers/misc/asus-laptop.c b/drivers/misc/asus-laptop.c
index 7c6dfd03de9f..de82f2f5a813 100644
--- a/drivers/misc/asus-laptop.c
+++ b/drivers/misc/asus-laptop.c
@@ -996,7 +996,7 @@ static int asus_hotk_add(struct acpi_device *device)
996 hotk->handle = device->handle; 996 hotk->handle = device->handle;
997 strcpy(acpi_device_name(device), ASUS_HOTK_DEVICE_NAME); 997 strcpy(acpi_device_name(device), ASUS_HOTK_DEVICE_NAME);
998 strcpy(acpi_device_class(device), ASUS_HOTK_CLASS); 998 strcpy(acpi_device_class(device), ASUS_HOTK_CLASS);
999 acpi_driver_data(device) = hotk; 999 device->driver_data = hotk;
1000 hotk->device = device; 1000 hotk->device = device;
1001 1001
1002 result = asus_hotk_check(); 1002 result = asus_hotk_check();
diff --git a/drivers/misc/eeepc-laptop.c b/drivers/misc/eeepc-laptop.c
index 1ee8501e90f1..c1247056116c 100644
--- a/drivers/misc/eeepc-laptop.c
+++ b/drivers/misc/eeepc-laptop.c
@@ -411,7 +411,7 @@ static int eeepc_hotk_add(struct acpi_device *device)
411 ehotk->handle = device->handle; 411 ehotk->handle = device->handle;
412 strcpy(acpi_device_name(device), EEEPC_HOTK_DEVICE_NAME); 412 strcpy(acpi_device_name(device), EEEPC_HOTK_DEVICE_NAME);
413 strcpy(acpi_device_class(device), EEEPC_HOTK_CLASS); 413 strcpy(acpi_device_class(device), EEEPC_HOTK_CLASS);
414 acpi_driver_data(device) = ehotk; 414 device->driver_data = ehotk;
415 ehotk->device = device; 415 ehotk->device = device;
416 result = eeepc_hotk_check(); 416 result = eeepc_hotk_check();
417 if (result) 417 if (result)
diff --git a/drivers/misc/fujitsu-laptop.c b/drivers/misc/fujitsu-laptop.c
index 3e56203e4947..7b69cfb7de5d 100644
--- a/drivers/misc/fujitsu-laptop.c
+++ b/drivers/misc/fujitsu-laptop.c
@@ -490,7 +490,7 @@ static int acpi_fujitsu_add(struct acpi_device *device)
490 fujitsu->acpi_handle = device->handle; 490 fujitsu->acpi_handle = device->handle;
491 sprintf(acpi_device_name(device), "%s", ACPI_FUJITSU_DEVICE_NAME); 491 sprintf(acpi_device_name(device), "%s", ACPI_FUJITSU_DEVICE_NAME);
492 sprintf(acpi_device_class(device), "%s", ACPI_FUJITSU_CLASS); 492 sprintf(acpi_device_class(device), "%s", ACPI_FUJITSU_CLASS);
493 acpi_driver_data(device) = fujitsu; 493 device->driver_data = fujitsu;
494 494
495 status = acpi_install_notify_handler(device->handle, 495 status = acpi_install_notify_handler(device->handle,
496 ACPI_DEVICE_NOTIFY, 496 ACPI_DEVICE_NOTIFY,
@@ -703,7 +703,7 @@ static int acpi_fujitsu_hotkey_add(struct acpi_device *device)
703 sprintf(acpi_device_name(device), "%s", 703 sprintf(acpi_device_name(device), "%s",
704 ACPI_FUJITSU_HOTKEY_DEVICE_NAME); 704 ACPI_FUJITSU_HOTKEY_DEVICE_NAME);
705 sprintf(acpi_device_class(device), "%s", ACPI_FUJITSU_CLASS); 705 sprintf(acpi_device_class(device), "%s", ACPI_FUJITSU_CLASS);
706 acpi_driver_data(device) = fujitsu_hotkey; 706 device->driver_data = fujitsu_hotkey;
707 707
708 status = acpi_install_notify_handler(device->handle, 708 status = acpi_install_notify_handler(device->handle,
709 ACPI_DEVICE_NOTIFY, 709 ACPI_DEVICE_NOTIFY,
diff --git a/drivers/misc/intel_menlow.c b/drivers/misc/intel_menlow.c
index 80a136352408..cd3ea7faa5b6 100644
--- a/drivers/misc/intel_menlow.c
+++ b/drivers/misc/intel_menlow.c
@@ -175,7 +175,7 @@ static int intel_menlow_memory_add(struct acpi_device *device)
175 goto end; 175 goto end;
176 } 176 }
177 177
178 acpi_driver_data(device) = cdev; 178 device->driver_data = cdev;
179 result = sysfs_create_link(&device->dev.kobj, 179 result = sysfs_create_link(&device->dev.kobj,
180 &cdev->device.kobj, "thermal_cooling"); 180 &cdev->device.kobj, "thermal_cooling");
181 if (result) 181 if (result)
diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c
index 6b9300779a43..62aebaa85913 100644
--- a/drivers/misc/thinkpad_acpi.c
+++ b/drivers/misc/thinkpad_acpi.c
@@ -543,7 +543,7 @@ static int __init setup_acpi_notify(struct ibm_struct *ibm)
543 return -ENODEV; 543 return -ENODEV;
544 } 544 }
545 545
546 acpi_driver_data(ibm->acpi->device) = ibm; 546 ibm->acpi->device->driver_data = ibm;
547 sprintf(acpi_device_class(ibm->acpi->device), "%s/%s", 547 sprintf(acpi_device_class(ibm->acpi->device), "%s/%s",
548 TPACPI_ACPI_EVENT_PREFIX, 548 TPACPI_ACPI_EVENT_PREFIX,
549 ibm->name); 549 ibm->name);