|
@@ -834,9 +834,10 @@ lcs_notify_lancmd_waiters(struct lcs_card *card, struct lcs_cmd *cmd)
|
|
|
* Emit buffer of a lan command.
|
|
|
*/
|
|
|
static void
|
|
|
-lcs_lancmd_timeout(unsigned long data)
|
|
|
+lcs_lancmd_timeout(struct timer_list *t)
|
|
|
{
|
|
|
- struct lcs_reply *reply, *list_reply, *r;
|
|
|
+ struct lcs_reply *reply = from_timer(reply, t, timer);
|
|
|
+ struct lcs_reply *list_reply, *r;
|
|
|
unsigned long flags;
|
|
|
|
|
|
LCS_DBF_TEXT(4, trace, "timeout");
|
|
@@ -864,7 +865,6 @@ lcs_send_lancmd(struct lcs_card *card, struct lcs_buffer *buffer,
|
|
|
{
|
|
|
struct lcs_reply *reply;
|
|
|
struct lcs_cmd *cmd;
|
|
|
- struct timer_list timer;
|
|
|
unsigned long flags;
|
|
|
int rc;
|
|
|
|
|
@@ -885,14 +885,10 @@ lcs_send_lancmd(struct lcs_card *card, struct lcs_buffer *buffer,
|
|
|
rc = lcs_ready_buffer(&card->write, buffer);
|
|
|
if (rc)
|
|
|
return rc;
|
|
|
- init_timer_on_stack(&timer);
|
|
|
- timer.function = lcs_lancmd_timeout;
|
|
|
- timer.data = (unsigned long) reply;
|
|
|
- timer.expires = jiffies + HZ*card->lancmd_timeout;
|
|
|
- add_timer(&timer);
|
|
|
+ timer_setup(&reply->timer, lcs_lancmd_timeout, 0);
|
|
|
+ mod_timer(&reply->timer, jiffies + HZ * card->lancmd_timeout);
|
|
|
wait_event(reply->wait_q, reply->received);
|
|
|
- del_timer_sync(&timer);
|
|
|
- destroy_timer_on_stack(&timer);
|
|
|
+ del_timer_sync(&reply->timer);
|
|
|
LCS_DBF_TEXT_(4, trace, "rc:%d",reply->rc);
|
|
|
rc = reply->rc;
|
|
|
lcs_put_reply(reply);
|