From: Bjorn Helgaas <bjorn.helgaas@hp.com>
To: Len Brown <lenb@kernel.org>
Cc: Zhao Yakui <yakui.zhao@intel.com>,
linux-acpi@vger.kernel.org, Alex Chiang <achiang@hp.com>,
Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Subject: [PATCH 5/9] ACPI: processor: remove .start() method
Date: Fri, 19 Jun 2009 15:31:59 -0600 [thread overview]
Message-ID: <20090619213159.18001.67811.stgit@bob.kio> (raw)
In-Reply-To: <20090619213038.18001.16533.stgit@bob.kio>
This patch folds the .start() method into .add().
acpi_processor_start() is always called immediately after
acpi_processor_add(), so there's really no point in having them be
separate methods.
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Reviewed-by: Alex Chiang <achiang@hp.com>
CC: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
CC: Zhao Yakui <yakui.zhao@intel.com>
---
drivers/acpi/processor_core.c | 44 +++++++----------------------------------
1 files changed, 7 insertions(+), 37 deletions(-)
diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c
index 5335ab6..3348c04 100644
--- a/drivers/acpi/processor_core.c
+++ b/drivers/acpi/processor_core.c
@@ -79,7 +79,6 @@ MODULE_DESCRIPTION("ACPI Processor Driver");
MODULE_LICENSE("GPL");
static int acpi_processor_add(struct acpi_device *device);
-static int acpi_processor_start(struct acpi_device *device);
static int acpi_processor_remove(struct acpi_device *device, int type);
static int acpi_processor_info_open_fs(struct inode *inode, struct file *file);
static void acpi_processor_notify(struct acpi_device *device, u32 event);
@@ -101,7 +100,6 @@ static struct acpi_driver acpi_processor_driver = {
.ops = {
.add = acpi_processor_add,
.remove = acpi_processor_remove,
- .start = acpi_processor_start,
.suspend = acpi_processor_suspend,
.resume = acpi_processor_resume,
.notify = acpi_processor_notify,
@@ -751,10 +749,8 @@ static struct notifier_block acpi_cpu_notifier =
static int acpi_processor_add(struct acpi_device *device)
{
struct acpi_processor *pr = NULL;
-
-
- if (!device)
- return -EINVAL;
+ int result = 0;
+ struct sys_device *sysdev;
pr = kzalloc(sizeof(struct acpi_processor), GFP_KERNEL);
if (!pr)
@@ -770,17 +766,6 @@ static int acpi_processor_add(struct acpi_device *device)
strcpy(acpi_device_class(device), ACPI_PROCESSOR_CLASS);
device->driver_data = pr;
- return 0;
-}
-
-static int __cpuinit acpi_processor_start(struct acpi_device *device)
-{
- int result = 0;
- struct acpi_processor *pr;
- struct sys_device *sysdev;
-
- pr = acpi_driver_data(device);
-
result = acpi_processor_get_info(device);
if (result) {
/* Processor is physically not present */
@@ -798,7 +783,8 @@ static int __cpuinit acpi_processor_start(struct acpi_device *device)
per_cpu(processor_device_array, pr->id) != device) {
printk(KERN_WARNING "BIOS reported wrong ACPI id "
"for the processor\n");
- return -ENODEV;
+ result = -ENODEV;
+ goto err_free_cpumask;
}
per_cpu(processor_device_array, pr->id) = device;
@@ -806,7 +792,7 @@ static int __cpuinit acpi_processor_start(struct acpi_device *device)
result = acpi_processor_add_fs(device);
if (result)
- return result;
+ goto err_free_cpumask;
sysdev = get_cpu_sysdev(pr->id);
if (sysfs_create_link(&device->dev.kobj, &sysdev->kobj, "sysdev")) {
@@ -869,6 +855,8 @@ err_power_exit:
acpi_processor_power_exit(pr, device);
err_remove_fs:
acpi_processor_remove_fs(device);
+err_free_cpumask:
+ free_cpumask_var(pr->throttling.shared_cpu_map);
return result;
}
@@ -947,7 +935,6 @@ int acpi_processor_device_add(acpi_handle handle, struct acpi_device **device)
{
acpi_handle phandle;
struct acpi_device *pdev;
- struct acpi_processor *pr;
if (acpi_get_parent(handle, &phandle)) {
@@ -962,12 +949,6 @@ int acpi_processor_device_add(acpi_handle handle, struct acpi_device **device)
return -ENODEV;
}
- acpi_bus_start(*device);
-
- pr = acpi_driver_data(*device);
- if (!pr)
- return -ENODEV;
-
return 0;
}
@@ -997,17 +978,6 @@ static void __ref acpi_processor_hotplug_notify(acpi_handle handle,
"Unable to add the device\n");
break;
}
-
- pr = acpi_driver_data(device);
- if (!pr) {
- printk(KERN_ERR PREFIX "Driver data is NULL\n");
- break;
- }
-
- result = acpi_processor_start(device);
- if (result)
- printk(KERN_ERR PREFIX "Device [%s] failed to start\n",
- acpi_device_bid(device));
break;
case ACPI_NOTIFY_EJECT_REQUEST:
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
next prev parent reply other threads:[~2009-06-19 21:31 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-19 21:31 [PATCH 0/9] ACPI: remove .start() and .stop() methods Bjorn Helgaas
2009-06-19 21:31 ` [PATCH 1/9] ACPI: memory hotplug: remove .start() method Bjorn Helgaas
2009-06-19 21:31 ` [PATCH 2/9] ACPI: processor: clean up in acpi_processor_start() error exits Bjorn Helgaas
2009-06-19 21:31 ` [PATCH 3/9] ACPI: processor: emit "online" event in acpi_processor_start() Bjorn Helgaas
2009-06-19 21:31 ` [PATCH 4/9] ACPI: processor: move acpi_processor_start() after acpi_processor_add() Bjorn Helgaas
2009-06-19 21:31 ` Bjorn Helgaas [this message]
2009-06-19 21:32 ` [PATCH 6/9] ACPI: EC: move acpi_ec_start() after acpi_ec_add() Bjorn Helgaas
2009-06-19 21:32 ` [PATCH 7/9] ACPI: EC: remove .start() method Bjorn Helgaas
2009-06-19 21:32 ` [PATCH 8/9] ACPI: EC: remove .stop() method Bjorn Helgaas
2009-06-19 21:32 ` [PATCH 9/9] ACPI: remove unused acpi_device_ops .stop method 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=20090619213159.18001.67811.stgit@bob.kio \
--to=bjorn.helgaas@hp.com \
--cc=achiang@hp.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=venkatesh.pallipadi@intel.com \
--cc=yakui.zhao@intel.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