Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 298611
b: refs/heads/master
c: a36cf84
h: refs/heads/master
i:
  298609: a111f84
  298607: ded9ecf
v: v3
  • Loading branch information
Stephen Boyd authored and Rafael J. Wysocki committed Mar 28, 2012
1 parent 7786b0c commit 2c686a3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 21 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: dddb5549da6b15ea8b9ce9ee0859c8d1fa268b5b
refs/heads/master: a36cf844c543c6193445a7b1492d16e5a8cf376e
27 changes: 7 additions & 20 deletions trunk/drivers/base/firmware_class.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@
#include <linux/interrupt.h>
#include <linux/bitops.h>
#include <linux/mutex.h>
#include <linux/kthread.h>
#include <linux/workqueue.h>
#include <linux/highmem.h>
#include <linux/firmware.h>
#include <linux/slab.h>
#include <linux/sched.h>

#define to_dev(obj) container_of(obj, struct device, kobj)

Expand Down Expand Up @@ -630,19 +631,15 @@ struct firmware_work {
bool uevent;
};

static int request_firmware_work_func(void *arg)
static void request_firmware_work_func(struct work_struct *work)
{
struct firmware_work *fw_work = arg;
struct firmware_work *fw_work;
const struct firmware *fw;
struct firmware_priv *fw_priv;
long timeout;
int ret;

if (!arg) {
WARN_ON(1);
return 0;
}

fw_work = container_of(work, struct firmware_work, work);
fw_priv = _request_firmware_prepare(&fw, fw_work->name, fw_work->device,
fw_work->uevent, true);
if (IS_ERR_OR_NULL(fw_priv)) {
Expand All @@ -667,8 +664,6 @@ static int request_firmware_work_func(void *arg)

module_put(fw_work->module);
kfree(fw_work);

return ret;
}

/**
Expand All @@ -694,7 +689,6 @@ request_firmware_nowait(
const char *name, struct device *device, gfp_t gfp, void *context,
void (*cont)(const struct firmware *fw, void *context))
{
struct task_struct *task;
struct firmware_work *fw_work;

fw_work = kzalloc(sizeof (struct firmware_work), gfp);
Expand All @@ -713,15 +707,8 @@ request_firmware_nowait(
return -EFAULT;
}

task = kthread_run(request_firmware_work_func, fw_work,
"firmware/%s", name);
if (IS_ERR(task)) {
fw_work->cont(NULL, fw_work->context);
module_put(fw_work->module);
kfree(fw_work);
return PTR_ERR(task);
}

INIT_WORK(&fw_work->work, request_firmware_work_func);
schedule_work(&fw_work->work);
return 0;
}

Expand Down

0 comments on commit 2c686a3

Please sign in to comment.