diff options
author | David Woodhouse <dwmw2@infradead.org> | 2007-12-15 02:02:56 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:07:33 -0500 |
commit | 5ba2f8a0217cd6116fcbac056b360bb0db045379 (patch) | |
tree | 06370f105a38270dd67387658e0d2ee0e587d2ec | |
parent | ecfe9b487c0d3f6b7ad58006888a56f01ae52b58 (diff) |
libertas: kill cleanup_cmdnode()
Move the wakeup into lbs_complete_command(), and leave the other bits
in __lbs_cleanup_and_insert_cmd() which was the only caller now anyway.
There are two remaining direct callers of lbs_cleanup_and_insert_cmd(),
and they are both fine without the wakeup.
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/libertas/cmd.c | 39 |
1 files changed, 17 insertions, 22 deletions
diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c index fd321ddf596e..4c0bd9f5c196 100644 --- a/drivers/net/wireless/libertas/cmd.c +++ b/drivers/net/wireless/libertas/cmd.c | |||
@@ -13,7 +13,6 @@ | |||
13 | #include "wext.h" | 13 | #include "wext.h" |
14 | #include "cmd.h" | 14 | #include "cmd.h" |
15 | 15 | ||
16 | static void cleanup_cmdnode(struct cmd_ctrl_node *ptempnode); | ||
17 | static struct cmd_ctrl_node *lbs_get_cmd_ctrl_node(struct lbs_private *priv); | 16 | static struct cmd_ctrl_node *lbs_get_cmd_ctrl_node(struct lbs_private *priv); |
18 | static void lbs_set_cmd_ctrl_node(struct lbs_private *priv, | 17 | static void lbs_set_cmd_ctrl_node(struct lbs_private *priv, |
19 | struct cmd_ctrl_node *ptempnode, | 18 | struct cmd_ctrl_node *ptempnode, |
@@ -1274,14 +1273,22 @@ static int lbs_cmd_mac_control(struct lbs_private *priv, | |||
1274 | * after cleans it. Requires priv->driver_lock held. | 1273 | * after cleans it. Requires priv->driver_lock held. |
1275 | */ | 1274 | */ |
1276 | static void __lbs_cleanup_and_insert_cmd(struct lbs_private *priv, | 1275 | static void __lbs_cleanup_and_insert_cmd(struct lbs_private *priv, |
1277 | struct cmd_ctrl_node *ptempcmd) | 1276 | struct cmd_ctrl_node *cmdnode) |
1278 | { | 1277 | { |
1278 | lbs_deb_enter(LBS_DEB_HOST); | ||
1279 | 1279 | ||
1280 | if (!ptempcmd) | 1280 | if (!cmdnode) |
1281 | return; | 1281 | goto out; |
1282 | 1282 | ||
1283 | cleanup_cmdnode(ptempcmd); | 1283 | cmdnode->pdata_buf = NULL; |
1284 | list_add_tail(&ptempcmd->list, &priv->cmdfreeq); | 1284 | cmdnode->callback = NULL; |
1285 | cmdnode->callback_arg = 0; | ||
1286 | |||
1287 | memset(cmdnode->cmdbuf, 0, LBS_CMD_BUFFER_SIZE); | ||
1288 | |||
1289 | list_add_tail(&cmdnode->list, &priv->cmdfreeq); | ||
1290 | out: | ||
1291 | lbs_deb_leave(LBS_DEB_HOST); | ||
1285 | } | 1292 | } |
1286 | 1293 | ||
1287 | static void lbs_cleanup_and_insert_cmd(struct lbs_private *priv, | 1294 | static void lbs_cleanup_and_insert_cmd(struct lbs_private *priv, |
@@ -1299,6 +1306,10 @@ void lbs_complete_command(struct lbs_private *priv, struct cmd_ctrl_node *cmd, | |||
1299 | { | 1306 | { |
1300 | if (cmd == priv->cur_cmd) | 1307 | if (cmd == priv->cur_cmd) |
1301 | priv->cur_cmd_retcode = result; | 1308 | priv->cur_cmd_retcode = result; |
1309 | |||
1310 | cmd->cmdwaitqwoken = 1; | ||
1311 | wake_up_interruptible(&cmd->cmdwait_q); | ||
1312 | |||
1302 | __lbs_cleanup_and_insert_cmd(priv, cmd); | 1313 | __lbs_cleanup_and_insert_cmd(priv, cmd); |
1303 | priv->cur_cmd = NULL; | 1314 | priv->cur_cmd = NULL; |
1304 | } | 1315 | } |
@@ -1771,22 +1782,6 @@ static struct cmd_ctrl_node *lbs_get_cmd_ctrl_node(struct lbs_private *priv) | |||
1771 | * @param ptempnode A pointer to cmdCtrlNode structure | 1782 | * @param ptempnode A pointer to cmdCtrlNode structure |
1772 | * @return n/a | 1783 | * @return n/a |
1773 | */ | 1784 | */ |
1774 | static void cleanup_cmdnode(struct cmd_ctrl_node *cmdnode) | ||
1775 | { | ||
1776 | lbs_deb_enter(LBS_DEB_HOST); | ||
1777 | |||
1778 | if (!cmdnode) | ||
1779 | return; | ||
1780 | cmdnode->cmdwaitqwoken = 1; | ||
1781 | wake_up_interruptible(&cmdnode->cmdwait_q); | ||
1782 | cmdnode->pdata_buf = NULL; | ||
1783 | cmdnode->callback = NULL; | ||
1784 | cmdnode->callback_arg = 0; | ||
1785 | |||
1786 | memset(cmdnode->cmdbuf, 0, LBS_CMD_BUFFER_SIZE); | ||
1787 | |||
1788 | lbs_deb_leave(LBS_DEB_HOST); | ||
1789 | } | ||
1790 | 1785 | ||
1791 | /** | 1786 | /** |
1792 | * @brief This function initializes the command node. | 1787 | * @brief This function initializes the command node. |