]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/acpi/acpi_memhotplug.c
Merge branch 'for-linus' of git://git.o-hand.com/linux-rpurdie-leds
[linux-2.6-omap-h63xx.git] / drivers / acpi / acpi_memhotplug.c
index c26172671fd882a175eb04cba40d6a8d1db8c304..71d21c51c45f573c6591d224e835843357df5981 100644 (file)
@@ -44,11 +44,6 @@ MODULE_AUTHOR("Naveen B S <naveen.b.s@intel.com>");
 MODULE_DESCRIPTION("Hotplug Mem Driver");
 MODULE_LICENSE("GPL");
 
-/* ACPI _STA method values */
-#define ACPI_MEMORY_STA_PRESENT                (0x00000001UL)
-#define ACPI_MEMORY_STA_ENABLED                (0x00000002UL)
-#define ACPI_MEMORY_STA_FUNCTIONAL     (0x00000008UL)
-
 /* Memory Device States */
 #define MEMORY_INVALID_STATE   0
 #define MEMORY_POWER_ON_STATE  1
@@ -58,10 +53,16 @@ static int acpi_memory_device_add(struct acpi_device *device);
 static int acpi_memory_device_remove(struct acpi_device *device, int type);
 static int acpi_memory_device_start(struct acpi_device *device);
 
+static const struct acpi_device_id memory_device_ids[] = {
+       {ACPI_MEMORY_DEVICE_HID, 0},
+       {"", 0},
+};
+MODULE_DEVICE_TABLE(acpi, memory_device_ids);
+
 static struct acpi_driver acpi_memory_device_driver = {
        .name = "acpi_memhotplug",
        .class = ACPI_MEMORY_DEVICE_CLASS,
-       .ids = ACPI_MEMORY_DEVICE_HID,
+       .ids = memory_device_ids,
        .ops = {
                .add = acpi_memory_device_add,
                .remove = acpi_memory_device_remove,
@@ -193,8 +194,7 @@ acpi_memory_get_device(acpi_handle handle,
 
 static int acpi_memory_check_device(struct acpi_memory_device *mem_device)
 {
-       unsigned long current_status;
-
+       unsigned long long current_status;
 
        /* Get device present/absent information from the _STA */
        if (ACPI_FAILURE(acpi_evaluate_integer(mem_device->device->handle, "_STA",
@@ -204,9 +204,9 @@ static int acpi_memory_check_device(struct acpi_memory_device *mem_device)
         * Check for device status. Device should be
         * present/enabled/functioning.
         */
-       if (!((current_status & ACPI_MEMORY_STA_PRESENT)
-             && (current_status & ACPI_MEMORY_STA_ENABLED)
-             && (current_status & ACPI_MEMORY_STA_FUNCTIONAL)))
+       if (!((current_status & ACPI_STA_DEVICE_PRESENT)
+             && (current_status & ACPI_STA_DEVICE_ENABLED)
+             && (current_status & ACPI_STA_DEVICE_FUNCTIONING)))
                return -ENODEV;
 
        return 0;
@@ -263,7 +263,7 @@ static int acpi_memory_powerdown_device(struct acpi_memory_device *mem_device)
        acpi_status status;
        struct acpi_object_list arg_list;
        union acpi_object arg;
-       unsigned long current_status;
+       unsigned long long current_status;
 
 
        /* Issue the _EJ0 command */
@@ -286,7 +286,7 @@ static int acpi_memory_powerdown_device(struct acpi_memory_device *mem_device)
                return -ENODEV;
 
        /* Check for device status.  Device should be disabled */
-       if (current_status & ACPI_MEMORY_STA_ENABLED)
+       if (current_status & ACPI_STA_DEVICE_ENABLED)
                return -EINVAL;
 
        return 0;
@@ -402,7 +402,7 @@ static int acpi_memory_device_add(struct acpi_device *device)
        mem_device->device = device;
        sprintf(acpi_device_name(device), "%s", ACPI_MEMORY_DEVICE_NAME);
        sprintf(acpi_device_class(device), "%s", ACPI_MEMORY_DEVICE_CLASS);
-       acpi_driver_data(device) = mem_device;
+       device->driver_data = mem_device;
 
        /* Get the range from the _CRS */
        result = acpi_memory_get_device_resources(mem_device);
@@ -453,8 +453,8 @@ static int acpi_memory_device_start (struct acpi_device *device)
                /* call add_memory func */
                result = acpi_memory_enable_device(mem_device);
                if (result)
-                       ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                               "Error in acpi_memory_enable_device\n"));
+                       printk(KERN_ERR PREFIX
+                               "Error in acpi_memory_enable_device\n");
        }
        return result;
 }