1 From c9481d30bbc84905f449b8c1bfc2c8f3eaefd9c3 Mon Sep 17 00:00:00 2001
2 From: Shaun Ruffell <sruffell@digium.com>
3 Date: Sun, 18 May 2014 02:49:30 -0500
4 Subject: [PATCH] pciradio: interruptible_sleep_on_timeout() ->
7 interruptible_sleep_on_timeout() has been deprecated for awhile and was finally
8 removed in Linux 3.15. Since interruptible_sleep_on_timeout() uses jiffies for
9 the delay, I assumed that each jiffy equated to 10ms given the age of the
12 Signed-off-by: Shaun Ruffell <sruffell@digium.com>
13 Acked-by: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
14 Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
16 drivers/dahdi/pciradio.c | 27 +++++++++++++--------------
17 1 file changed, 13 insertions(+), 14 deletions(-)
19 diff --git a/drivers/dahdi/pciradio.c b/drivers/dahdi/pciradio.c
20 index 9231593..07b85b3 100644
21 --- a/drivers/dahdi/pciradio.c
22 +++ b/drivers/dahdi/pciradio.c
23 @@ -52,6 +52,7 @@ With driver: 303826 (1.5 %)
24 #include <linux/interrupt.h>
25 #include <linux/moduleparam.h>
26 #include <linux/sched.h>
27 +#include <linux/delay.h>
29 #include <asm/delay.h>
31 @@ -481,8 +482,6 @@ static void rbi_out(struct pciradio *rad, int n, unsigned char *rbicmd)
35 -DECLARE_WAIT_QUEUE_HEAD(mywait);
40 @@ -490,7 +489,8 @@ DECLARE_WAIT_QUEUE_HEAD(mywait);
41 x = rad->remote_locked || (__pciradio_getcreg(rad,0xc) & 2);
42 if (!x) rad->remote_locked = 1;
43 spin_unlock_irqrestore(&rad->lock,flags);
44 - if (x) interruptible_sleep_on_timeout(&mywait,2);
46 + msleep_interruptible(20);
49 spin_lock_irqsave(&rad->lock,flags);
50 @@ -527,7 +527,6 @@ static void mx828_command(struct pciradio *rad,int channel, unsigned char comman
52 static void mx828_command_wait(struct pciradio *rad,int channel, unsigned char command, unsigned char *byte1, unsigned char *byte2)
54 -DECLARE_WAIT_QUEUE_HEAD(mywait);
58 @@ -535,7 +534,7 @@ unsigned long flags;
59 while(rad->encdec.state)
61 spin_unlock_irqrestore(&rad->lock,flags);
62 - interruptible_sleep_on_timeout(&mywait,2);
63 + msleep_interruptible(20);
64 spin_lock_irqsave(&rad->lock,flags);
66 rad->encdec.lastcmd = jiffies + 1000;
67 @@ -967,7 +966,6 @@ static int pciradio_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned lo
70 struct pciradio *rad = chan->pvt;
71 - DECLARE_WAIT_QUEUE_HEAD(mywait);
74 case DAHDI_RADIO_GETPARAM:
75 @@ -1255,7 +1253,7 @@ static int pciradio_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned lo
76 __pciradio_setcreg(rad,8,byte2);
77 spin_unlock_irqrestore(&rad->lock,flags);
78 if (i || (jiffies < rad->lastremcmd + 10))
79 - interruptible_sleep_on_timeout(&mywait,10);
80 + msleep_interruptible(100);
81 rad->lastremcmd = jiffies;
82 rbi_out(rad,chan->chanpos - 1,(unsigned char *)&stack.p.data);
83 spin_lock_irqsave(&rad->lock,flags);
84 @@ -1270,7 +1268,8 @@ static int pciradio_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned lo
85 x = rad->remote_locked || (__pciradio_getcreg(rad,0xc) & 2);
86 if (!x) rad->remote_locked = 1;
87 spin_unlock_irqrestore(&rad->lock,flags);
88 - if (x) interruptible_sleep_on_timeout(&mywait,2);
90 + msleep_interruptible(20);
93 spin_lock_irqsave(&rad->lock,flags);
94 @@ -1287,14 +1286,14 @@ static int pciradio_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned lo
95 __pciradio_setcreg(rad,8,byte2);
96 spin_unlock_irqrestore(&rad->lock,flags);
98 - interruptible_sleep_on_timeout(&mywait,3);
99 + msleep_interruptible(30);
100 while (jiffies < rad->lastremcmd + 10)
101 - interruptible_sleep_on_timeout(&mywait,10);
102 + msleep_interruptible(100);
103 rad->lastremcmd = jiffies;
106 if (!(__pciradio_getcreg(rad,0xc) & 2)) break;
107 - interruptible_sleep_on_timeout(&mywait,2);
108 + msleep_interruptible(20);
110 spin_lock_irqsave(&rad->lock,flags);
111 /* enable and address async serializer */
112 @@ -1316,7 +1315,7 @@ static int pciradio_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned lo
113 (!strchr((char *)rad->rxbuf,'\r'))))
115 spin_unlock_irqrestore(&rad->lock,flags);
116 - interruptible_sleep_on_timeout(&mywait,2);
117 + msleep_interruptible(20);
118 spin_lock_irqsave(&rad->lock,flags);
121 @@ -1336,7 +1335,7 @@ static int pciradio_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned lo
122 while(rad->txlen && (rad->txindex < rad->txlen))
124 spin_unlock_irqrestore(&rad->lock,flags);
125 - interruptible_sleep_on_timeout(&mywait,2);
126 + msleep_interruptible(20);
127 spin_lock_irqsave(&rad->lock,flags);
129 /* disable and un-address async serializer */
130 @@ -1345,7 +1344,7 @@ static int pciradio_ioctl(struct dahdi_chan *chan, unsigned int cmd, unsigned lo
131 rad->remote_locked = 0;
132 spin_unlock_irqrestore(&rad->lock,flags);
133 if (rad->remmode[chan->chanpos - 1] == DAHDI_RADPAR_REM_SERIAL_ASCII)
134 - interruptible_sleep_on_timeout(&mywait,100);
135 + msleep_interruptible(1000);
136 if (copy_to_user((__user void *) data, &stack.p, sizeof(stack.p))) return -EFAULT;