]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/misc/intel_menlow.c
ACPI: catch calls of acpi_driver_data on pointer of wrong type
[linux-2.6-omap-h63xx.git] / drivers / misc / intel_menlow.c
index f70984ab1e1bdfd2c1aa25a32108f6b96117f83b..cd3ea7faa5b6bd4cf55d3bd2ec2c2c0436f0ae41 100644 (file)
@@ -170,21 +170,22 @@ static int intel_menlow_memory_add(struct acpi_device *device)
 
        cdev = thermal_cooling_device_register("Memory controller", device,
                                               &memory_cooling_ops);
-       acpi_driver_data(device) = cdev;
-       if (!cdev)
-               result = -ENODEV;
-       else {
-               result = sysfs_create_link(&device->dev.kobj,
-                                       &cdev->device.kobj, "thermal_cooling");
-               if (result)
-                       goto unregister;
-
-               result = sysfs_create_link(&cdev->device.kobj,
-                                       &device->dev.kobj, "device");
-               if (result) {
-                       sysfs_remove_link(&device->dev.kobj, "thermal_cooling");
-                       goto unregister;
-               }
+       if (IS_ERR(cdev)) {
+               result = PTR_ERR(cdev);
+               goto end;
+       }
+
+       device->driver_data = cdev;
+       result = sysfs_create_link(&device->dev.kobj,
+                               &cdev->device.kobj, "thermal_cooling");
+       if (result)
+               goto unregister;
+
+       result = sysfs_create_link(&cdev->device.kobj,
+                               &device->dev.kobj, "device");
+       if (result) {
+               sysfs_remove_link(&device->dev.kobj, "thermal_cooling");
+               goto unregister;
        }
 
  end:
@@ -210,7 +211,7 @@ static int intel_menlow_memory_remove(struct acpi_device *device, int type)
        return 0;
 }
 
-const static struct acpi_device_id intel_menlow_memory_ids[] = {
+static const struct acpi_device_id intel_menlow_memory_ids[] = {
        {"INT0002", 0},
        {"", 0},
 };