commit 8b223551e794f21ba49e5496aacc69e742d585cc
Author: Jan RÄ™korajski <[email protected]>
Date:   Fri Jul 11 23:16:11 2014 +0200

    - fix building with kernel 3.15

 dahdi-linux.spec |   2 +
 linux-3.15.patch | 141 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 143 insertions(+)
---
diff --git a/dahdi-linux.spec b/dahdi-linux.spec
index bcbea09..7ae7e37 100644
--- a/dahdi-linux.spec
+++ b/dahdi-linux.spec
@@ -77,6 +77,7 @@ Source6:      %{FIRMWARE_URL}/dahdi-fw-tc400m-MR6.12.tar.gz
 # Source6-md5: 2ea860bb8a9d8ede2858b9557b74ee3c
 Source7:       %{FIRMWARE_URL}/dahdi-fw-hx8-2.06.tar.gz
 # Source7-md5: a7f3886942bb3e9fed349a41b3390c9f
+Patch0:                linux-3.15.patch
 URL:           http://www.asterisk.org/
 BuildRequires: rpmbuild(macros) >= 1.678
 %{?with_dist_kernel:%{expand:%kbrs}}
@@ -179,6 +180,7 @@ cd ../..\
 
 %prep
 %setup -q -n %{pname}-%{version}
+%patch0 -p1
 
 for a in %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE6} %{SOURCE7}; do
        ln -s $a drivers/dahdi/firmware
diff --git a/linux-3.15.patch b/linux-3.15.patch
new file mode 100644
index 0000000..4caf8cb
--- /dev/null
+++ b/linux-3.15.patch
@@ -0,0 +1,141 @@
+From c9481d30bbc84905f449b8c1bfc2c8f3eaefd9c3 Mon Sep 17 00:00:00 2001
+From: Shaun Ruffell <[email protected]>
+Date: Sun, 18 May 2014 02:49:30 -0500
+Subject: [PATCH] pciradio: interruptible_sleep_on_timeout() ->
+ msleep_interruptible()
+
+interruptible_sleep_on_timeout() has been deprecated for awhile and was finally
+removed in Linux 3.15. Since interruptible_sleep_on_timeout() uses jiffies for
+the delay, I assumed that each jiffy equated to 10ms given the age of the
+driver.
+
+Signed-off-by: Shaun Ruffell <[email protected]>
+Acked-by: Tzafrir Cohen <[email protected]>
+Signed-off-by: Russ Meyerriecks <[email protected]>
+---
+ drivers/dahdi/pciradio.c | 27 +++++++++++++--------------
+ 1 file changed, 13 insertions(+), 14 deletions(-)
+
+diff --git a/drivers/dahdi/pciradio.c b/drivers/dahdi/pciradio.c
+index 9231593..07b85b3 100644
+--- a/drivers/dahdi/pciradio.c
++++ b/drivers/dahdi/pciradio.c
+@@ -52,6 +52,7 @@ With driver: 303826  (1.5 %)
+ #include <linux/interrupt.h>
+ #include <linux/moduleparam.h>
+ #include <linux/sched.h>
++#include <linux/delay.h>
+ #include <asm/io.h>
+ #include <asm/delay.h> 
+ 
+@@ -481,8 +482,6 @@ static void rbi_out(struct pciradio *rad, int n, unsigned 
char *rbicmd)
+ {
+ unsigned long flags;
+ int   x;
+-DECLARE_WAIT_QUEUE_HEAD(mywait);
+-
+ 
+       for(;;)
+       {
+@@ -490,7 +489,8 @@ DECLARE_WAIT_QUEUE_HEAD(mywait);
+               x = rad->remote_locked || (__pciradio_getcreg(rad,0xc) & 2);
+               if (!x) rad->remote_locked = 1;
+               spin_unlock_irqrestore(&rad->lock,flags);
+-              if (x) interruptible_sleep_on_timeout(&mywait,2);
++              if (x)
++                      msleep_interruptible(20);
+               else break;
+       }       
+       spin_lock_irqsave(&rad->lock,flags);
+@@ -527,7 +527,6 @@ static void mx828_command(struct pciradio *rad,int 
channel, unsigned char comman
+ 
+ static void mx828_command_wait(struct pciradio *rad,int channel, unsigned 
char command, unsigned char *byte1, unsigned char *byte2)
+ {
+-DECLARE_WAIT_QUEUE_HEAD(mywait);
+ unsigned long flags;
+ 
+ 
+@@ -535,7 +534,7 @@ unsigned long flags;
+       while(rad->encdec.state)
+       {
+               spin_unlock_irqrestore(&rad->lock,flags);  
+-              interruptible_sleep_on_timeout(&mywait,2);   
++              msleep_interruptible(20);
+               spin_lock_irqsave(&rad->lock,flags);  
+       }
+       rad->encdec.lastcmd = jiffies + 1000;
+@@ -967,7 +966,6 @@ static int pciradio_ioctl(struct dahdi_chan *chan, 
unsigned int cmd, unsigned lo
+       } stack;
+ 
+       struct pciradio *rad = chan->pvt;
+-      DECLARE_WAIT_QUEUE_HEAD(mywait);
+ 
+       switch (cmd) {
+       case DAHDI_RADIO_GETPARAM:
+@@ -1255,7 +1253,7 @@ static int pciradio_ioctl(struct dahdi_chan *chan, 
unsigned int cmd, unsigned lo
+                               __pciradio_setcreg(rad,8,byte2);
+                               spin_unlock_irqrestore(&rad->lock,flags);
+                               if (i || (jiffies < rad->lastremcmd + 10))
+-                                      
interruptible_sleep_on_timeout(&mywait,10);
++                                      msleep_interruptible(100);
+                               rad->lastremcmd = jiffies;
+                               rbi_out(rad,chan->chanpos - 1,(unsigned char 
*)&stack.p.data);
+                               spin_lock_irqsave(&rad->lock,flags);
+@@ -1270,7 +1268,8 @@ static int pciradio_ioctl(struct dahdi_chan *chan, 
unsigned int cmd, unsigned lo
+                               x = rad->remote_locked || 
(__pciradio_getcreg(rad,0xc) & 2);
+                               if (!x) rad->remote_locked = 1;
+                               spin_unlock_irqrestore(&rad->lock,flags);
+-                              if (x) 
interruptible_sleep_on_timeout(&mywait,2);
++                              if (x)
++                                      msleep_interruptible(20);
+                               else break;
+                       }       
+                       spin_lock_irqsave(&rad->lock,flags);
+@@ -1287,14 +1286,14 @@ static int pciradio_ioctl(struct dahdi_chan *chan, 
unsigned int cmd, unsigned lo
+                       __pciradio_setcreg(rad,8,byte2);
+                       spin_unlock_irqrestore(&rad->lock,flags);
+                       if (byte1 != byte2) 
+-                              interruptible_sleep_on_timeout(&mywait,3);
++                              msleep_interruptible(30);
+                       while (jiffies < rad->lastremcmd + 10)
+-                              interruptible_sleep_on_timeout(&mywait,10);
++                              msleep_interruptible(100);
+                       rad->lastremcmd = jiffies;
+                       for(;;)
+                       {
+                               if (!(__pciradio_getcreg(rad,0xc) & 2)) break;
+-                              interruptible_sleep_on_timeout(&mywait,2);
++                              msleep_interruptible(20);
+                       }
+                       spin_lock_irqsave(&rad->lock,flags);
+                       /* enable and address async serializer */
+@@ -1316,7 +1315,7 @@ static int pciradio_ioctl(struct dahdi_chan *chan, 
unsigned int cmd, unsigned lo
+                                       (!strchr((char *)rad->rxbuf,'\r'))))
+                               {
+                                       
spin_unlock_irqrestore(&rad->lock,flags);
+-                                      
interruptible_sleep_on_timeout(&mywait,2);
++                                      msleep_interruptible(20);
+                                       spin_lock_irqsave(&rad->lock,flags);
+                                       continue;
+                               }
+@@ -1336,7 +1335,7 @@ static int pciradio_ioctl(struct dahdi_chan *chan, 
unsigned int cmd, unsigned lo
+                               while(rad->txlen && (rad->txindex < rad->txlen))
+                               {
+                                       
spin_unlock_irqrestore(&rad->lock,flags);
+-                                      
interruptible_sleep_on_timeout(&mywait,2);
++                                      msleep_interruptible(20);
+                                       spin_lock_irqsave(&rad->lock,flags);
+                               }
+                               /* disable and un-address async serializer */
+@@ -1345,7 +1344,7 @@ static int pciradio_ioctl(struct dahdi_chan *chan, 
unsigned int cmd, unsigned lo
+                       rad->remote_locked = 0;
+                       spin_unlock_irqrestore(&rad->lock,flags);
+                       if (rad->remmode[chan->chanpos - 1] == 
DAHDI_RADPAR_REM_SERIAL_ASCII)
+-                              interruptible_sleep_on_timeout(&mywait,100);
++                              msleep_interruptible(1000);
+                       if (copy_to_user((__user void *) data, &stack.p, 
sizeof(stack.p))) return -EFAULT;
+                       return 0;
+               default:
+-- 
+1.9.3
+
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/dahdi-linux.git/commitdiff/8b223551e794f21ba49e5496aacc69e742d585cc

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to