@@ -1191,7 +1191,7 @@ check_sub_bridges(acpi_handle handle, u32 lvl, void *context, void **rv)
}
struct acpiphp_hp_work {
- struct work_struct work;
+ struct delayed_work work;
acpi_handle handle;
u32 type;
void *context;
@@ -1199,7 +1199,8 @@ struct acpiphp_hp_work {
static void alloc_acpiphp_hp_work(acpi_handle handle, u32 type,
void *context,
- void (*func)(struct work_struct *work))
+ void (*func)(struct work_struct *work),
+ unsigned long delay)
{
struct acpiphp_hp_work *hp_work;
int ret;
@@ -1212,8 +1213,8 @@ static void alloc_acpiphp_hp_work(acpi_handle handle, u32 type,
hp_work->type = type;
hp_work->context = context;
- INIT_WORK(&hp_work->work, func);
- ret = queue_work(kacpi_hotplug_wq, &hp_work->work);
+ INIT_DELAYED_WORK(&hp_work->work, func);
+ ret = queue_delayed_work(kacpi_hotplug_wq, &hp_work->work, delay);
if (!ret)
kfree(hp_work);
}
@@ -1230,7 +1231,8 @@ static void _handle_hotplug_event_bridge(struct work_struct *work)
acpi_handle handle;
u32 type;
- hp_work = container_of(work, struct acpiphp_hp_work, work);
+ hp_work = container_of(to_delayed_work(work),
+ struct acpiphp_hp_work, work);
handle = hp_work->handle;
type = hp_work->type;
@@ -1334,7 +1336,7 @@ static void handle_hotplug_event_bridge(acpi_handle handle, u32 type,
* don't deadlock on hotplug actions.
*/
alloc_acpiphp_hp_work(handle, type, context,
- _handle_hotplug_event_bridge);
+ _handle_hotplug_event_bridge, 0);
}
static void _handle_hotplug_event_func(struct work_struct *work)
@@ -1348,7 +1350,8 @@ static void _handle_hotplug_event_func(struct work_struct *work)
u32 type;
void *context;
- hp_work = container_of(work, struct acpiphp_hp_work, work);
+ hp_work = container_of(to_delayed_work(work),
+ struct acpiphp_hp_work, work);
handle = hp_work->handle;
type = hp_work->type;
context = hp_work->context;
@@ -1410,7 +1413,7 @@ static void handle_hotplug_event_func(acpi_handle handle, u32 type,
* don't deadlock on hotplug actions.
*/
alloc_acpiphp_hp_work(handle, type, context,
- _handle_hotplug_event_func);
+ _handle_hotplug_event_func, 0);
}
static acpi_status