From: Alex Chiang <achiang@hp.com>
To: lenb@kernel.org
Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-pci@vger.kernel.org
Subject: [PATCH v3 04/12] ACPI: rearrange acpi_pci_bind/acpi_pci_unbind in pci_bind.c
Date: Wed, 10 Jun 2009 13:55:25 -0600 [thread overview]
Message-ID: <20090610195525.28982.43678.stgit@bob.kio> (raw)
In-Reply-To: <20090610194714.28982.51363.stgit@bob.kio>
This is a pure code movement patch that does $subject in order
to make the following patch easier to read and review.
No functional change.
Signed-off-by: Alex Chiang <achiang@hp.com>
---
drivers/acpi/pci_bind.c | 90 ++++++++++++++++++++++++-----------------------
1 files changed, 45 insertions(+), 45 deletions(-)
diff --git a/drivers/acpi/pci_bind.c b/drivers/acpi/pci_bind.c
index 236765c..c283c29 100644
--- a/drivers/acpi/pci_bind.c
+++ b/drivers/acpi/pci_bind.c
@@ -109,6 +109,51 @@ acpi_status acpi_get_pci_id(acpi_handle handle, struct acpi_pci_id *id)
EXPORT_SYMBOL(acpi_get_pci_id);
+static int acpi_pci_unbind(struct acpi_device *device)
+{
+ int result = 0;
+ acpi_status status;
+ struct acpi_pci_data *data;
+ struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
+
+
+ if (!device || !device->parent)
+ return -EINVAL;
+
+ status = acpi_get_name(device->handle, ACPI_FULL_PATHNAME, &buffer);
+ if (ACPI_FAILURE(status))
+ return -ENODEV;
+
+ ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Unbinding PCI device [%s]...\n",
+ (char *) buffer.pointer));
+ kfree(buffer.pointer);
+
+ status =
+ acpi_get_data(device->handle, acpi_pci_data_handler,
+ (void **)&data);
+ if (ACPI_FAILURE(status)) {
+ result = -ENODEV;
+ goto end;
+ }
+
+ status = acpi_detach_data(device->handle, acpi_pci_data_handler);
+ if (ACPI_FAILURE(status)) {
+ ACPI_EXCEPTION((AE_INFO, status,
+ "Unable to detach data from device %s",
+ acpi_device_bid(device)));
+ result = -ENODEV;
+ goto end;
+ }
+ if (data->dev->subordinate) {
+ acpi_pci_irq_del_prt(data->id.segment, data->bus->number);
+ }
+ pci_dev_put(data->dev);
+ kfree(data);
+
+ end:
+ return result;
+}
+
static int acpi_pci_bind(struct acpi_device *device)
{
int result = 0;
@@ -253,51 +298,6 @@ static int acpi_pci_bind(struct acpi_device *device)
return result;
}
-static int acpi_pci_unbind(struct acpi_device *device)
-{
- int result = 0;
- acpi_status status;
- struct acpi_pci_data *data;
- struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
-
-
- if (!device || !device->parent)
- return -EINVAL;
-
- status = acpi_get_name(device->handle, ACPI_FULL_PATHNAME, &buffer);
- if (ACPI_FAILURE(status))
- return -ENODEV;
-
- ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Unbinding PCI device [%s]...\n",
- (char *) buffer.pointer));
- kfree(buffer.pointer);
-
- status =
- acpi_get_data(device->handle, acpi_pci_data_handler,
- (void **)&data);
- if (ACPI_FAILURE(status)) {
- result = -ENODEV;
- goto end;
- }
-
- status = acpi_detach_data(device->handle, acpi_pci_data_handler);
- if (ACPI_FAILURE(status)) {
- ACPI_EXCEPTION((AE_INFO, status,
- "Unable to detach data from device %s",
- acpi_device_bid(device)));
- result = -ENODEV;
- goto end;
- }
- if (data->dev->subordinate) {
- acpi_pci_irq_del_prt(data->id.segment, data->bus->number);
- }
- pci_dev_put(data->dev);
- kfree(data);
-
- end:
- return result;
-}
-
int
acpi_pci_bind_root(struct acpi_device *device,
struct acpi_pci_id *id, struct pci_bus *bus)
next prev parent reply other threads:[~2009-06-10 19:56 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-10 19:55 [PATCH v3 00/12] Dynamic ACPI-PCI binding Alex Chiang
2009-06-10 19:55 ` [PATCH v3 01/12] ACPI: make acpi_pci_bind() static Alex Chiang
2009-06-10 19:55 ` [PATCH v3 02/12] ACPI: Introduce acpi_is_root_bridge() Alex Chiang
2009-06-10 19:55 ` [PATCH v3 03/12] ACPI: Introduce acpi_get_pci_dev() Alex Chiang
2009-06-10 19:55 ` Alex Chiang [this message]
2009-06-10 19:55 ` [PATCH v3 05/12] ACPI: eviscerate pci_bind.c Alex Chiang
2009-06-10 19:55 ` [PATCH v3 06/12] ACPI: simplify acpi_pci_irq_add_prt() API Alex Chiang
2009-06-10 19:55 ` [PATCH v3 07/12] ACPI: simplify acpi_pci_irq_del_prt() API Alex Chiang
2009-06-10 19:55 ` [PATCH v3 08/12] ACPI: acpi_pci_unbind should clean up properly after acpi_pci_bind Alex Chiang
2009-06-10 19:55 ` [PATCH v3 09/12] PCI Hotplug: acpiphp: convert to acpi_get_pci_dev Alex Chiang
2009-06-10 19:55 ` [PATCH v3 10/12] ACPI: kill acpi_get_pci_id Alex Chiang
2009-06-10 19:56 ` [PATCH v3 11/12] ACPI: video: convert to acpi_get_pci_dev Alex Chiang
2009-06-25 22:38 ` Alex Riesen
2009-06-25 23:05 ` Alex Chiang
2009-06-26 6:43 ` Troy Moure
2009-06-26 10:56 ` Alex Riesen
2009-06-26 12:28 ` Alex Riesen
2009-06-26 19:19 ` Jesse Barnes
2009-06-26 19:28 ` Alex Chiang
2009-06-10 19:56 ` [PATCH v3 12/12] ACPI: kill acpi_get_physical_pci_device() Alex Chiang
2009-06-11 19:22 ` [PATCH v3 00/12] Dynamic ACPI-PCI binding Bjorn Helgaas
2009-06-18 3:36 ` Len Brown
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=20090610195525.28982.43678.stgit@bob.kio \
--to=achiang@hp.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
/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