diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index 688b7f7c23dda7e12548bb58f32369bac42029c9..95547efcffe0293f5e341dc2be3bd18fbf367e0d 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -203,7 +203,7 @@ acpi_eject_store(struct device *d, struct device_attribute *attr,
 		return -EINVAL;
 	}
 #ifndef FORCE_EJECT
-	if (acpi_device->driver == NULL) {
+	if (!acpi_device->driver && !acpi_device->handler) {
 		ret = -ENODEV;
 		goto err;
 	}