aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mailbox/mailbox-altera.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mailbox/mailbox-altera.c')
-rw-r--r--drivers/mailbox/mailbox-altera.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/mailbox/mailbox-altera.c b/drivers/mailbox/mailbox-altera.c
index bb682c926b0a..bcb29df9549e 100644
--- a/drivers/mailbox/mailbox-altera.c
+++ b/drivers/mailbox/mailbox-altera.c
@@ -57,6 +57,7 @@ struct altera_mbox {
57 57
58 /* If the controller supports only RX polling mode */ 58 /* If the controller supports only RX polling mode */
59 struct timer_list rxpoll_timer; 59 struct timer_list rxpoll_timer;
60 struct mbox_chan *chan;
60}; 61};
61 62
62static struct altera_mbox *mbox_chan_to_altera_mbox(struct mbox_chan *chan) 63static struct altera_mbox *mbox_chan_to_altera_mbox(struct mbox_chan *chan)
@@ -138,12 +139,11 @@ static void altera_mbox_rx_data(struct mbox_chan *chan)
138 } 139 }
139} 140}
140 141
141static void altera_mbox_poll_rx(unsigned long data) 142static void altera_mbox_poll_rx(struct timer_list *t)
142{ 143{
143 struct mbox_chan *chan = (struct mbox_chan *)data; 144 struct altera_mbox *mbox = from_timer(mbox, t, rxpoll_timer);
144 struct altera_mbox *mbox = mbox_chan_to_altera_mbox(chan);
145 145
146 altera_mbox_rx_data(chan); 146 altera_mbox_rx_data(mbox->chan);
147 147
148 mod_timer(&mbox->rxpoll_timer, 148 mod_timer(&mbox->rxpoll_timer,
149 jiffies + msecs_to_jiffies(MBOX_POLLING_MS)); 149 jiffies + msecs_to_jiffies(MBOX_POLLING_MS));
@@ -206,8 +206,8 @@ static int altera_mbox_startup_receiver(struct mbox_chan *chan)
206 206
207polling: 207polling:
208 /* Setup polling timer */ 208 /* Setup polling timer */
209 setup_timer(&mbox->rxpoll_timer, altera_mbox_poll_rx, 209 mbox->chan = chan;
210 (unsigned long)chan); 210 timer_setup(&mbox->rxpoll_timer, altera_mbox_poll_rx, 0);
211 mod_timer(&mbox->rxpoll_timer, 211 mod_timer(&mbox->rxpoll_timer,
212 jiffies + msecs_to_jiffies(MBOX_POLLING_MS)); 212 jiffies + msecs_to_jiffies(MBOX_POLLING_MS));
213 213