libertas: clean up direct command handling
Move direct command handling through __lbs_cmd() over to using the
header as the first member of the command structure, and only define
the __lbs_cmd() callback in one place rather than 3. Convert boot2
version command to new usage.
Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
diff --git a/drivers/net/wireless/libertas/cmdresp.c b/drivers/net/wireless/libertas/cmdresp.c
index 7bad257..9113669 100644
--- a/drivers/net/wireless/libertas/cmdresp.c
+++ b/drivers/net/wireless/libertas/cmdresp.c
@@ -861,9 +861,10 @@
spin_unlock_irqrestore(&priv->driver_lock, flags);
- if (priv->cur_cmd && priv->cur_cmd->callback)
- ret = priv->cur_cmd->callback(priv, priv->cur_cmd->callback_arg, resp);
- else
+ if (priv->cur_cmd && priv->cur_cmd->callback) {
+ ret = priv->cur_cmd->callback(priv, priv->cur_cmd->callback_arg,
+ (struct cmd_header *) resp);
+ } else
ret = handle_cmd_response(priv, 0, resp);
spin_lock_irqsave(&priv->driver_lock, flags);