[PATCH] naming memory hotplug's phys_device take2 [2/3] name memory hot-added by acpi

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch work with "changing phys_device from int to string" patch.
This exports acpi object name in dsdt to memory hotplug control sysfs.

Signed-Off-By: KAMEZAWA Hiroyu <[email protected]>

Index: linux-2.6.16-rc5-mm2/drivers/acpi/acpi_memhotplug.c
===================================================================
--- linux-2.6.16-rc5-mm2.orig/drivers/acpi/acpi_memhotplug.c	2006-03-07 15:12:01.000000000 +0900
+++ linux-2.6.16-rc5-mm2/drivers/acpi/acpi_memhotplug.c	2006-03-07 15:28:08.000000000 +0900
@@ -1,3 +1,4 @@
+
 /*
  * Copyright (C) 2004 Intel Corporation <[email protected]>
  *
@@ -30,6 +31,7 @@
 #include <linux/init.h>
 #include <linux/types.h>
 #include <linux/memory_hotplug.h>
+#include <linux/memory.h>
 #include <acpi/acpi_drivers.h>
 
 #define ACPI_MEMORY_DEVICE_COMPONENT		0x08000000UL
@@ -178,6 +180,22 @@
 	return_VALUE(0);
 }
 
+static int acpi_memory_device_export_name(struct acpi_memory_device *mem_device)
+{
+	struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
+	acpi_status result;
+	int ret;
+
+	result = acpi_get_name(mem_device->handle, ACPI_FULL_PATHNAME, &buffer);
+	if (ACPI_FAILURE(result))
+		return result;
+	ret = memory_device_export_name(mem_device->start_addr,
+				mem_device->start_addr + mem_device->length,
+				buffer.pointer);
+	acpi_os_free(buffer.pointer);
+	return_VALUE(ret);
+}
+
 static int acpi_memory_enable_device(struct acpi_memory_device *mem_device)
 {
 	int result;
@@ -203,6 +221,11 @@
 		return result;
 	}
 
+	/*
+	 * export ACPI memory object name from sysfs's memory object
+	 */
+	result = acpi_memory_device_export_name(mem_device);
+
 	return result;
 }
 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux