]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/acpi/acpi_memhotplug.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
[mv-sheeva.git] / drivers / acpi / acpi_memhotplug.c
index 37cbe72d17ebf22cef28846fceaed51e35842e0e..9a62224cc27816b039d116cc1732acad7080fdb2 100644 (file)
@@ -242,7 +242,12 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device)
                        num_enabled++;
                        continue;
                }
-
+               /*
+                * If the memory block size is zero, please ignore it.
+                * Don't try to do the following memory hotplug flowchart.
+                */
+               if (!info->length)
+                       continue;
                if (node < 0)
                        node = memory_add_physaddr_to_nid(info->start_addr);
 
@@ -257,8 +262,15 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device)
                mem_device->state = MEMORY_INVALID_STATE;
                return -EINVAL;
        }
-
-       return result;
+       /*
+        * Sometimes the memory device will contain several memory blocks.
+        * When one memory block is hot-added to the system memory, it will
+        * be regarded as a success.
+        * Otherwise if the last memory block can't be hot-added to the system
+        * memory, it will be failure and the memory device can't be bound with
+        * driver.
+        */
+       return 0;
 }
 
 static int acpi_memory_powerdown_device(struct acpi_memory_device *mem_device)