diff options
author | Pavel Roskin <proski@gnu.org> | 2007-06-02 14:00:24 -0400 |
---|---|---|
committer | Guido Guenther <agx@bogon.sigxcpu.org> | 2007-06-03 18:38:22 +0200 |
commit | 5a98cd97e234ccb9842aa94b719fc3440fac5532 (patch) | |
tree | 6f36659b17086095e7480619e6408f5ca68bab78 | |
parent | 2830c34666a96eb97c006cdf3a3a23ca7c142f8c (diff) |
[PATCH] Don't reschedule firmware loading
at76_probe() is run in the process context and doesn't need to delay the
firmware download. Rescheduling doesn't guarantee the execution order,
so it's better to make the order predictable. It also makes it possible
to handle errors in the firmware download.
Signed-off-by: Pavel Roskin <proski@gnu.org>
-rw-r--r-- | at76_usb.c | 14 | ||||
-rw-r--r-- | at76_usb.h | 2 |
2 files changed, 4 insertions, 12 deletions
@@ -4264,10 +4264,8 @@ static int at76_init_new_device(struct at76_priv *priv) /* Download external firmware */ -static void at76_work_external_fw(struct work_struct *work) +static void at76_load_external_fw(struct at76_priv *priv) { - struct at76_priv *priv = container_of(work, struct at76_priv, - work_external_fw); int ret; int op_mode; @@ -4307,10 +4305,8 @@ static void at76_work_external_fw(struct work_struct *work) /* Download internal firmware */ -static void at76_work_internal_fw(struct work_struct *work) +static void at76_load_internal_fw(struct at76_priv *priv) { - struct at76_priv *priv = container_of(work, struct at76_priv, - work_internal_fw); int ret; mutex_lock(&priv->mtx); @@ -6127,8 +6123,6 @@ static struct at76_priv *at76_alloc_new_device(struct usb_device *udev, mutex_init(&priv->mtx); INIT_WORK(&priv->work_assoc_done, at76_work_assoc_done); - INIT_WORK(&priv->work_external_fw, at76_work_external_fw); - INIT_WORK(&priv->work_internal_fw, at76_work_internal_fw); INIT_WORK(&priv->work_join, at76_work_join); INIT_WORK(&priv->work_mgmt_timeout, at76_work_mgmt_timeout); INIT_WORK(&priv->work_new_bss, at76_work_new_bss); @@ -6285,7 +6279,7 @@ static int at76_probe(struct usb_interface *interface, /* download internal firmware part */ at76_dbg(DBG_DEVSTART, "downloading internal firmware"); priv->istate = INTFW_DOWNLOAD; - schedule_work(&priv->work_internal_fw); + at76_load_internal_fw(priv); } else { /* Internal firmware already inside the device. Get firmware * version to test if external firmware is loaded. @@ -6320,7 +6314,7 @@ static int at76_probe(struct usb_interface *interface, "- download external firmware", ret); priv->istate = EXTFW_DOWNLOAD; - schedule_work(&priv->work_external_fw); + at76_load_external_fw(priv); } else { priv->istate = INIT; if ((ret = at76_init_new_device(priv)) < 0) @@ -470,8 +470,6 @@ struct at76_priv { /* work queues */ struct work_struct work_assoc_done; - struct work_struct work_external_fw; - struct work_struct work_internal_fw; struct work_struct work_join; struct work_struct work_mgmt_timeout; struct work_struct work_new_bss; |