]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/misc/intel_menlow.c
Merge git://git.infradead.org/mtd-2.6
[linux-2.6-omap-h63xx.git] / drivers / misc / intel_menlow.c
index 0c0bb3093e07e7ab1afea5c37acfb38ac83394dc..e00a2756e97e110654387efec263855a0cd5aaa3 100644 (file)
@@ -57,7 +57,7 @@ static int memory_get_int_max_bandwidth(struct thermal_cooling_device *cdev,
 {
        struct acpi_device *device = cdev->devdata;
        acpi_handle handle = device->handle;
-       unsigned long value;
+       unsigned long long value;
        struct acpi_object_list arg_list;
        union acpi_object arg;
        acpi_status status = AE_OK;
@@ -90,7 +90,7 @@ static int memory_get_cur_bandwidth(struct thermal_cooling_device *cdev,
 {
        struct acpi_device *device = cdev->devdata;
        acpi_handle handle = device->handle;
-       unsigned long value;
+       unsigned long long value;
        struct acpi_object_list arg_list;
        union acpi_object arg;
        acpi_status status = AE_OK;
@@ -104,7 +104,7 @@ static int memory_get_cur_bandwidth(struct thermal_cooling_device *cdev,
        if (ACPI_FAILURE(status))
                return -EFAULT;
 
-       return sprintf(buf, "%ld\n", value);
+       return sprintf(buf, "%llu\n", value);
 }
 
 static int memory_set_cur_bandwidth(struct thermal_cooling_device *cdev,
@@ -115,7 +115,7 @@ static int memory_set_cur_bandwidth(struct thermal_cooling_device *cdev,
        struct acpi_object_list arg_list;
        union acpi_object arg;
        acpi_status status;
-       int temp;
+       unsigned long long temp;
        unsigned long max_state;
 
        if (memory_get_int_max_bandwidth(cdev, &max_state))
@@ -131,7 +131,7 @@ static int memory_set_cur_bandwidth(struct thermal_cooling_device *cdev,
 
        status =
            acpi_evaluate_integer(handle, MEMORY_SET_BANDWIDTH, &arg_list,
-                                 (unsigned long *)&temp);
+                                 &temp);
 
        printk(KERN_INFO
               "Bandwidth value was %d: status is %d\n", state, status);
@@ -175,19 +175,17 @@ static int intel_menlow_memory_add(struct acpi_device *device)
                goto end;
        }
 
-       if (cdev) {
-               acpi_driver_data(device) = 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;
-               }
+       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:
@@ -254,7 +252,8 @@ static DEFINE_MUTEX(intel_menlow_attr_lock);
  * @auxtype : AUX0/AUX1
  * @buf: syfs buffer
  */
-static int sensor_get_auxtrip(acpi_handle handle, int index, int *value)
+static int sensor_get_auxtrip(acpi_handle handle, int index,
+                                                       unsigned long long *value)
 {
        acpi_status status;
 
@@ -262,7 +261,7 @@ static int sensor_get_auxtrip(acpi_handle handle, int index, int *value)
                return -EINVAL;
 
        status = acpi_evaluate_integer(handle, index ? GET_AUX1 : GET_AUX0,
-                                      NULL, (unsigned long *)value);
+                                      NULL, value);
        if (ACPI_FAILURE(status))
                return -EIO;
 
@@ -284,13 +283,13 @@ static int sensor_set_auxtrip(acpi_handle handle, int index, int value)
        struct acpi_object_list args = {
                1, &arg
        };
-       int temp;
+       unsigned long long temp;
 
        if (index != 0 && index != 1)
                return -EINVAL;
 
        status = acpi_evaluate_integer(handle, index ? GET_AUX0 : GET_AUX1,
-                                      NULL, (unsigned long *)&temp);
+                                      NULL, &temp);
        if (ACPI_FAILURE(status))
                return -EIO;
        if ((index && value < temp) || (!index && value > temp))
@@ -298,7 +297,7 @@ static int sensor_set_auxtrip(acpi_handle handle, int index, int value)
 
        arg.integer.value = value;
        status = acpi_evaluate_integer(handle, index ? SET_AUX1 : SET_AUX0,
-                                      &args, (unsigned long *)&temp);
+                                      &args, &temp);
        if (ACPI_FAILURE(status))
                return -EIO;
 
@@ -314,7 +313,7 @@ static ssize_t aux0_show(struct device *dev,
                         struct device_attribute *dev_attr, char *buf)
 {
        struct intel_menlow_attribute *attr = to_intel_menlow_attr(dev_attr);
-       int value;
+       unsigned long long value;
        int result;
 
        result = sensor_get_auxtrip(attr->handle, 0, &value);
@@ -326,7 +325,7 @@ static ssize_t aux1_show(struct device *dev,
                         struct device_attribute *dev_attr, char *buf)
 {
        struct intel_menlow_attribute *attr = to_intel_menlow_attr(dev_attr);
-       int value;
+       unsigned long long value;
        int result;
 
        result = sensor_get_auxtrip(attr->handle, 1, &value);
@@ -378,7 +377,7 @@ static ssize_t bios_enabled_show(struct device *dev,
                                 struct device_attribute *attr, char *buf)
 {
        acpi_status status;
-       unsigned long bios_enabled;
+       unsigned long long bios_enabled;
 
        status = acpi_evaluate_integer(NULL, BIOS_ENABLED, NULL, &bios_enabled);
        if (ACPI_FAILURE(status))
@@ -494,7 +493,7 @@ static int __init intel_menlow_module_init(void)
 {
        int result = -ENODEV;
        acpi_status status;
-       unsigned long enable;
+       unsigned long long enable;
 
        if (acpi_disabled)
                return result;