Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 154163
b: refs/heads/master
c: c8d72a5
h: refs/heads/master
i:
  154161: b1ca0d4
  154159: 646b20e
v: v3
  • Loading branch information
Zhang Rui authored and Len Brown committed Jun 24, 2009
1 parent b29a73c commit 717b16b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c02256be79a1a3557332ac51e653d574a2a7d2b5
refs/heads/master: c8d72a5e76988140bfdfd8722f2228d94e7fa10f
20 changes: 8 additions & 12 deletions trunk/drivers/acpi/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ acpi_device_modalias_show(struct device *dev, struct device_attribute *attr, cha
}
static DEVICE_ATTR(modalias, 0444, acpi_device_modalias_show, NULL);

static int acpi_bus_hot_remove_device(void *context)
static void acpi_bus_hot_remove_device(void *context)
{
struct acpi_device *device;
acpi_handle handle = context;
Expand All @@ -104,18 +104,18 @@ static int acpi_bus_hot_remove_device(void *context)
acpi_status status = AE_OK;

if (acpi_bus_get_device(handle, &device))
return 0;
return;

if (!device)
return 0;
return;

ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Hot-removing device %s...\n", dev_name(&device->dev)));

if (acpi_bus_trim(device, 1)) {
printk(KERN_ERR PREFIX
"Removing device failed\n");
return -1;
return;
}

/* power off device */
Expand All @@ -142,9 +142,10 @@ static int acpi_bus_hot_remove_device(void *context)
*/
status = acpi_evaluate_object(handle, "_EJ0", &arg_list, NULL);
if (ACPI_FAILURE(status))
return -ENODEV;
printk(KERN_WARNING PREFIX
"Eject device failed\n");

return 0;
return;
}

static ssize_t
Expand All @@ -155,7 +156,6 @@ acpi_eject_store(struct device *d, struct device_attribute *attr,
acpi_status status;
acpi_object_type type = 0;
struct acpi_device *acpi_device = to_acpi_device(d);
struct task_struct *task;

if ((!count) || (buf[0] != '1')) {
return -EINVAL;
Expand All @@ -172,11 +172,7 @@ acpi_eject_store(struct device *d, struct device_attribute *attr,
goto err;
}

/* remove the device in another thread to fix the deadlock issue */
task = kthread_run(acpi_bus_hot_remove_device,
acpi_device->handle, "acpi_hot_remove_device");
if (IS_ERR(task))
ret = PTR_ERR(task);
acpi_os_hotplug_execute(acpi_bus_hot_remove_device, acpi_device->handle);
err:
return ret;
}
Expand Down

0 comments on commit 717b16b

Please sign in to comment.