aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/acpi/scan.c6
-rw-r--r--include/acpi/acpi_bus.h1
2 files changed, 5 insertions, 2 deletions
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index 2a82645c9dfe..06b86faf037f 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -229,9 +229,9 @@ static int acpi_device_remove(struct device * dev)
229 229
230 if (acpi_drv) { 230 if (acpi_drv) {
231 if (acpi_drv->ops.stop) 231 if (acpi_drv->ops.stop)
232 acpi_drv->ops.stop(acpi_dev, ACPI_BUS_REMOVAL_NORMAL); 232 acpi_drv->ops.stop(acpi_dev, acpi_dev->removal_type);
233 if (acpi_drv->ops.remove) 233 if (acpi_drv->ops.remove)
234 acpi_drv->ops.remove(acpi_dev, ACPI_BUS_REMOVAL_NORMAL); 234 acpi_drv->ops.remove(acpi_dev, acpi_dev->removal_type);
235 } 235 }
236 acpi_dev->driver = NULL; 236 acpi_dev->driver = NULL;
237 acpi_driver_data(dev) = NULL; 237 acpi_driver_data(dev) = NULL;
@@ -294,6 +294,7 @@ static void acpi_device_register(struct acpi_device *device,
294 device_add(&device->dev); 294 device_add(&device->dev);
295 295
296 acpi_device_setup_files(device); 296 acpi_device_setup_files(device);
297 device->removal_type = ACPI_BUS_REMOVAL_NORMAL;
297} 298}
298 299
299static void acpi_device_unregister(struct acpi_device *device, int type) 300static void acpi_device_unregister(struct acpi_device *device, int type)
@@ -859,6 +860,7 @@ static int acpi_bus_remove(struct acpi_device *dev, int rmdevice)
859 if (!dev) 860 if (!dev)
860 return -EINVAL; 861 return -EINVAL;
861 862
863 dev->removal_type = ACPI_BUS_REMOVAL_EJECT;
862 device_release_driver(&dev->dev); 864 device_release_driver(&dev->dev);
863 865
864 if (!rmdevice) 866 if (!rmdevice)
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index 8976dbea63ca..58dc8f651861 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -301,6 +301,7 @@ struct acpi_device {
301 void *driver_data; 301 void *driver_data;
302 struct device dev; 302 struct device dev;
303 struct acpi_bus_ops bus_ops; /* workaround for different code path for hotplug */ 303 struct acpi_bus_ops bus_ops; /* workaround for different code path for hotplug */
304 enum acpi_bus_removal_type removal_type; /* indicate for different removal type */
304}; 305};
305 306
306#define acpi_driver_data(d) ((d)->driver_data) 307#define acpi_driver_data(d) ((d)->driver_data)