public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Helgaas <bjorn.helgaas@hp.com>
To: Len Brown <lenb@kernel.org>
Cc: linux-acpi@vger.kernel.org, Dave Hansen <haveblue@us.ibm.com>,
	Alex Chiang <achiang@hp.com>,
	Yasunori Goto <y-goto@jp.fujitsu.com>
Subject: [PATCH 5/9] ACPI: memory hotplug: remove .start() method
Date: Mon, 22 Jun 2009 14:41:25 -0600	[thread overview]
Message-ID: <20090622204124.32761.97057.stgit@bob.kio> (raw)
In-Reply-To: <20090622204016.32761.47464.stgit@bob.kio>

This patch folds the .start() method into .add().

The .start() method is called in two paths: boot-time device enumeration
and run-time node addition, currently via container_device_add().  In both
cases, .start() is called immediately after .add(), so there's no reason
to make them separate methods.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Reviewed-by: Alex Chiang <achiang@hp.com>
CC: Yasunori Goto <y-goto@jp.fujitsu.com>
CC: Dave Hansen <haveblue@us.ibm.com>
---
 drivers/acpi/acpi_memhotplug.c |   40 ++++++++++++++--------------------------
 1 files changed, 14 insertions(+), 26 deletions(-)

diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c
index 7a0f4aa..a8d9d8f 100644
--- a/drivers/acpi/acpi_memhotplug.c
+++ b/drivers/acpi/acpi_memhotplug.c
@@ -50,7 +50,6 @@ MODULE_LICENSE("GPL");
 
 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},
@@ -65,7 +64,6 @@ static struct acpi_driver acpi_memory_device_driver = {
 	.ops = {
 		.add = acpi_memory_device_add,
 		.remove = acpi_memory_device_remove,
-		.start = acpi_memory_device_start,
 		},
 };
 
@@ -415,28 +413,6 @@ static int acpi_memory_device_add(struct acpi_device *device)
 
 	printk(KERN_DEBUG "%s \n", acpi_device_name(device));
 
-	return result;
-}
-
-static int acpi_memory_device_remove(struct acpi_device *device, int type)
-{
-	struct acpi_memory_device *mem_device = NULL;
-
-
-	if (!device || !acpi_driver_data(device))
-		return -EINVAL;
-
-	mem_device = acpi_driver_data(device);
-	kfree(mem_device);
-
-	return 0;
-}
-
-static int acpi_memory_device_start (struct acpi_device *device)
-{
-	struct acpi_memory_device *mem_device;
-	int result = 0;
-
 	/*
 	 * Early boot code has recognized memory area by EFI/E820.
 	 * If DSDT shows these memory devices on boot, hotplug is not necessary
@@ -446,8 +422,6 @@ static int acpi_memory_device_start (struct acpi_device *device)
 	if (!acpi_hotmem_initialized)
 		return 0;
 
-	mem_device = acpi_driver_data(device);
-
 	if (!acpi_memory_check_device(mem_device)) {
 		/* call add_memory func */
 		result = acpi_memory_enable_device(mem_device);
@@ -458,6 +432,20 @@ static int acpi_memory_device_start (struct acpi_device *device)
 	return result;
 }
 
+static int acpi_memory_device_remove(struct acpi_device *device, int type)
+{
+	struct acpi_memory_device *mem_device = NULL;
+
+
+	if (!device || !acpi_driver_data(device))
+		return -EINVAL;
+
+	mem_device = acpi_driver_data(device);
+	kfree(mem_device);
+
+	return 0;
+}
+
 /*
  * Helper function to check for memory device
  */


  parent reply	other threads:[~2009-06-22 20:41 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-22 20:40 [PATCH 0/9 v2] ACPI: remove .start() and .stop() methods Bjorn Helgaas
2009-06-22 20:41 ` [PATCH 1/9] ACPI: processor: remove KOBJ_ONLINE/KOBJ_OFFLINE events Bjorn Helgaas
2009-06-22 20:41 ` [PATCH 2/9] ACPI: processor: clean up in acpi_processor_start() error exits Bjorn Helgaas
2009-06-22 20:41 ` [PATCH 3/9] ACPI: processor: move acpi_processor_start() after acpi_processor_add() Bjorn Helgaas
2009-06-22 20:41 ` [PATCH 4/9] ACPI: processor: remove .start() method Bjorn Helgaas
2009-06-22 20:41 ` Bjorn Helgaas [this message]
2009-06-22 20:41 ` [PATCH 6/9] ACPI: EC: move acpi_ec_start() after acpi_ec_add() Bjorn Helgaas
2009-06-22 20:41 ` [PATCH 7/9] ACPI: EC: remove .start() method Bjorn Helgaas
2009-06-22 20:41 ` [PATCH 8/9] ACPI: EC: remove .stop() method Bjorn Helgaas
2009-06-22 20:41 ` [PATCH 9/9] ACPI: remove unused acpi_device_ops .stop method Bjorn Helgaas
2009-06-24  1:23 ` [PATCH 0/9 v2] ACPI: remove .start() and .stop() methods Len Brown
2009-06-25  2:09 ` Yasunori Goto
2009-06-29 20:32   ` Bjorn Helgaas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090622204124.32761.97057.stgit@bob.kio \
    --to=bjorn.helgaas@hp.com \
    --cc=achiang@hp.com \
    --cc=haveblue@us.ibm.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=y-goto@jp.fujitsu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox