From: Len Brown <len.brown@intel.com>
To: linux-acpi@vger.kernel.org
Cc: Li Shaohua <shaohua.li@intel.com>,
Zhang Rui <rui.zhang@intel.com>, Len Brown <len.brown@intel.com>
Subject: [PATCH 9/13] ACPI: add acpi_bus_removal_type in acpi_device
Date: Fri, 24 Nov 2006 00:17:37 -0500 [thread overview]
Message-ID: <11643454722679-git-send-email-len.brown@intel.com> (raw)
Message-ID: <68d72528fc25d05d0f6fc17212ea5f695448bee2.1164343921.git.len.brown@intel.com> (raw)
In-Reply-To: <11643454711040-git-send-email-len.brown@intel.com>
In-Reply-To: <bd119392c453771fdb994728a2568c2e3f17705d.1164343921.git.len.brown@intel.com>
From: Li Shaohua <shaohua.li@intel.com>
Add removal_type in structure acpi_device for hot removal.
ACPI_BUS_REMOVAL_EJECT is used for ACPI device hot removal.
Only one parameter is allowed in .remove method due to driver model.
So removal_type is added to indicate different removal type.
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
---
drivers/acpi/scan.c | 6 ++++--
include/acpi/acpi_bus.h | 1 +
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index 2a82645..06b86fa 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -229,9 +229,9 @@ static int acpi_device_remove(struct dev
if (acpi_drv) {
if (acpi_drv->ops.stop)
- acpi_drv->ops.stop(acpi_dev, ACPI_BUS_REMOVAL_NORMAL);
+ acpi_drv->ops.stop(acpi_dev, acpi_dev->removal_type);
if (acpi_drv->ops.remove)
- acpi_drv->ops.remove(acpi_dev, ACPI_BUS_REMOVAL_NORMAL);
+ acpi_drv->ops.remove(acpi_dev, acpi_dev->removal_type);
}
acpi_dev->driver = NULL;
acpi_driver_data(dev) = NULL;
@@ -294,6 +294,7 @@ static void acpi_device_register(struct
device_add(&device->dev);
acpi_device_setup_files(device);
+ device->removal_type = ACPI_BUS_REMOVAL_NORMAL;
}
static void acpi_device_unregister(struct acpi_device *device, int type)
@@ -859,6 +860,7 @@ static int acpi_bus_remove(struct acpi_d
if (!dev)
return -EINVAL;
+ dev->removal_type = ACPI_BUS_REMOVAL_EJECT;
device_release_driver(&dev->dev);
if (!rmdevice)
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index b7baac7..168ef22 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -301,6 +301,7 @@ struct acpi_device {
void *driver_data;
struct device dev;
struct acpi_bus_ops bus_ops; /* workaround for different code path for hotplug */
+ enum acpi_bus_removal_type removal_type; /* indicate for different removal type */
};
#define acpi_driver_data(d) ((d)->driver_data)
--
1.4.4.g59427
next prev parent reply other threads:[~2006-11-24 5:14 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-24 5:17 contents of sysfs branch Len Brown
2006-11-24 5:17 ` [PATCH 1/13] ACPI: clean up scan.c Len Brown
2006-11-24 5:17 ` Len Brown
2006-11-24 5:17 ` [PATCH 2/13] ACPI: rename some functions Len Brown
2006-11-24 5:17 ` Len Brown
2006-11-24 5:17 ` [PATCH 3/13] ACPI: add device_driver and helper functions Len Brown
2006-11-24 5:17 ` Len Brown
2006-11-24 5:17 ` [PATCH 4/13] ACPI: add ACPI bus_type for driver model Len Brown
2006-11-24 5:17 ` Len Brown
2006-11-24 5:17 ` [PATCH 5/13] ACPI: change registration interface to follow " Len Brown
2006-11-24 5:17 ` Len Brown
2006-11-24 5:17 ` [PATCH 6/13] ACPI: adjust init order Len Brown
2006-11-24 5:17 ` Len Brown
2006-11-24 5:17 ` [PATCH 7/13] ACPI: convert to sysfs framework Len Brown
2006-11-24 5:17 ` Len Brown
2006-11-24 5:17 ` [PATCH 8/13] ACPI: add acpi_bus_ops in acpi_device Len Brown
2006-11-24 5:17 ` Len Brown
2006-11-24 5:17 ` Len Brown [this message]
2006-11-24 5:17 ` [PATCH 9/13] ACPI: add acpi_bus_removal_type " Len Brown
2006-11-24 5:17 ` [PATCH 10/13] ACPI: consolidate two motherboard drivers into one Len Brown
2006-11-24 5:17 ` Len Brown
2006-11-24 5:17 ` [PATCH 11/13] ACPI: Convert ACPI PCI .bind/.unbind to use PCI bridge driver Len Brown
2006-11-24 5:17 ` Len Brown
2006-11-24 5:17 ` [PATCH 12/13] ACPI: Set fake hid for non-PNPID ACPI devices Len Brown
2006-11-24 5:17 ` Len Brown
2006-11-24 5:17 ` [PATCH 13/13] ACPI: use unique number as bus_id of ACPI device in sysfs Len Brown
2006-11-24 5:17 ` Len Brown
2006-11-24 6:36 ` Len Brown
2006-11-24 9:40 ` Zhang Rui
2006-11-26 5:10 ` Zhang Rui
2006-11-27 6:10 ` Len Brown
2006-11-27 6:35 ` Zhang Rui
2006-11-27 6:06 ` Len Brown
2006-12-01 8:55 ` updated patches of sysfs branch Zhang Rui
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=11643454722679-git-send-email-len.brown@intel.com \
--to=len.brown@intel.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=rui.zhang@intel.com \
--cc=shaohua.li@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.