]> git.pld-linux.org Git - packages/vpb-driver.git/commitdiff
- fix building kernel module for linux 5.6 auto/th/vpb-driver-4.2.58-6
authorJan Rękorajski <baggins@pld-linux.org>
Tue, 7 Apr 2020 21:23:58 +0000 (23:23 +0200)
committerJan Rękorajski <baggins@pld-linux.org>
Tue, 7 Apr 2020 21:23:58 +0000 (23:23 +0200)
- rel 6

kernel-5.6.patch [new file with mode: 0644]
vpb-driver.spec

diff --git a/kernel-5.6.patch b/kernel-5.6.patch
new file mode 100644 (file)
index 0000000..6f305e2
--- /dev/null
@@ -0,0 +1,164 @@
+diff -ur vpb-driver-4.2.58/src/vpb/vpb.c vpb-driver-4.2.58-kernel-5.6/src/vpb/vpb.c
+--- vpb-driver-4.2.58/src/vpb/vpb.c    2020-04-07 23:21:44.462483689 +0200
++++ vpb-driver-4.2.58-kernel-5.6/src/vpb/vpb.c 2020-04-07 23:21:12.351359828 +0200
+@@ -284,7 +284,11 @@
+                       printk(KERN_INFO NAME ": tmp [0x%lx] dev->res2 [0x%lx]\n",
+                                               tmp, (unsigned long)dev->resource[2].start);
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0)
+                         base2[numPCI] = ioremap_nocache(dev->resource[2].start &
++#else
++                        base2[numPCI] = ioremap(dev->resource[2].start &
++#endif
+                                                 PCI_BASE_ADDRESS_MEM_MASK,
+                                                 sizeof(short)*SIZE_WD);
+diff -ur vpb-driver-4.2.58/src/vtcore/vtcore_main.c vpb-driver-4.2.58-kernel-5.6/src/vtcore/vtcore_main.c
+--- vpb-driver-4.2.58/src/vtcore/vtcore_main.c 2014-09-28 20:02:28.000000000 +0200
++++ vpb-driver-4.2.58-kernel-5.6/src/vtcore/vtcore_main.c      2020-04-07 23:13:43.483613391 +0200
+@@ -225,12 +225,21 @@
+       return single_open(file, vt_int_proc_show, PDE_DATA(inode));
+ }
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0)
+ const struct file_operations vt_int_proc_fops = {
+       .open           = vt_int_proc_open,
+       .read           = seq_read,
+       .llseek         = seq_lseek,
+       .release        = single_release,
+ }; //}}}
++#else
++const struct proc_ops vt_int_proc_fops = {
++      .proc_open              = vt_int_proc_open,
++      .proc_read              = seq_read,
++      .proc_lseek             = seq_lseek,
++      .proc_release   = single_release,
++}; //}}}
++#endif
+ static int vt_string_proc_show(struct seq_file *m, void *v)
+ { //{{{
+@@ -243,12 +252,21 @@
+       return single_open(file, vt_string_proc_show, PDE_DATA(inode));
+ }
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0)
+ const struct file_operations vt_string_proc_fops = {
+       .open           = vt_string_proc_open,
+       .read           = seq_read,
+       .llseek         = seq_lseek,
+       .release        = single_release,
+ }; //}}}
++#else
++const struct proc_ops vt_string_proc_fops = {
++      .proc_open              = vt_string_proc_open,
++      .proc_read              = seq_read,
++      .proc_lseek             = seq_lseek,
++      .proc_release   = single_release,
++}; //}}}
++#endif
+ int __init vtcore_init(void)
+@@ -1081,6 +1099,7 @@
+       return ret;
+ }
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0)
+ static const struct file_operations vt_country_proc_fops = {
+       .owner          = THIS_MODULE,
+       .open           = vt_country_proc_open,
+@@ -1089,6 +1108,15 @@
+       .release        = single_release,
+       .write          = vt_country_proc_write,
+ }; //}}}
++#else
++static const struct proc_ops vt_country_proc_fops = {
++      .proc_open              = vt_country_proc_open,
++      .proc_read              = seq_read,
++      .proc_lseek             = seq_lseek,
++      .proc_release   = single_release,
++      .proc_write             = vt_country_proc_write,
++}; //}}}
++#endif
+ // Template definitions for port ops that communicate a single integer value.
+ // {{{
+@@ -1158,6 +1186,7 @@
+       return ret;                                                             \
+ }
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0)
+ #define PROC_READ_PORT(attrib)                                                        \
+       PROC_READ_PORT_(attrib)                                                 \
+                                                                               \
+@@ -1180,6 +1209,29 @@
+       .release        = single_release,                                       \
+       .write          = vt_##attrib##_proc_write,                             \
+ };
++#else
++#define PROC_READ_PORT(attrib)                                                        \
++      PROC_READ_PORT_(attrib)                                                 \
++                                                                              \
++static const struct proc_ops vt_##attrib##_proc_fops = {                      \
++      .proc_open      = vt_##attrib##_proc_open,                              \
++      .proc_read      = seq_read,                                             \
++      .proc_lseek     = seq_lseek,                                            \
++      .proc_release   = single_release,                                       \
++};
++
++#define PROC_READWRITE_PORT(attrib)                                           \
++      PROC_READ_PORT_(attrib)                                                 \
++      PROC_WRITE_PORT_(attrib)                                                \
++                                                                              \
++static const struct proc_ops vt_##attrib##_proc_fops = {                      \
++      .proc_open      = vt_##attrib##_proc_open,                              \
++      .proc_read      = seq_read,                                             \
++      .proc_lseek     = seq_lseek,                                            \
++      .proc_release   = single_release,                                       \
++      .proc_write     = vt_##attrib##_proc_write,                             \
++};
++#endif
+ //}}}
+ PROC_READWRITE_PORT(playgain)
+diff -ur vpb-driver-4.2.58/src/vtcore/vtmodule.h vpb-driver-4.2.58-kernel-5.6/src/vtcore/vtmodule.h
+--- vpb-driver-4.2.58/src/vtcore/vtmodule.h    2014-09-28 20:02:28.000000000 +0200
++++ vpb-driver-4.2.58-kernel-5.6/src/vtcore/vtmodule.h 2020-04-07 23:20:06.772506361 +0200
+@@ -9,6 +9,7 @@
+ #define __VTMODULE__
+ #include <linux/cdev.h>
++#include <linux/proc_fs.h>
+ #include "linringbuf.h"
+@@ -159,8 +160,13 @@
+ void vt_read(struct vtboard *board);
+ int vt_send_event(struct vtboard *board, char *mess, int size);
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0)
+ const struct file_operations vt_int_proc_fops;
+ const struct file_operations vt_string_proc_fops;
++#else
++const struct proc_ops vt_int_proc_fops;
++const struct proc_ops vt_string_proc_fops;
++#endif
+ void vt_create_board_proc_const_int(struct vtboard *board, const char *node, long val);
+ #endif
+diff -ur vpb-driver-4.2.58/src/vtcore/vtopenswitch.c vpb-driver-4.2.58-kernel-5.6/src/vtcore/vtopenswitch.c
+--- vpb-driver-4.2.58/src/vtcore/vtopenswitch.c        2014-09-28 20:02:28.000000000 +0200
++++ vpb-driver-4.2.58-kernel-5.6/src/vtcore/vtopenswitch.c     2020-04-07 23:09:27.362701175 +0200
+@@ -1642,7 +1642,11 @@
+       //XXX The new way.
+       //void __iomem * map = pci_iomap(dev, bar, maxbytes);
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0)
+       card->base0 = ioremap_nocache( pci_resource_start(pdev,0),
++#else
++      card->base0 = ioremap( pci_resource_start(pdev,0),
++#endif
+                                      pci_resource_len(pdev,0) );
+       card->base2 = ioremap( pci_resource_start(pdev,2),
+                              pci_resource_len(pdev,2) );
index 00396a784febafc5cfc7d7cda763a04d1ec0225e..98f6d6d37bf3e7ba4ba712f24bc5b7c9bd3ec5f3 100644 (file)
@@ -21,7 +21,7 @@ exit 1
 
 %define                _duplicate_files_terminate_build        0
 
-%define                rel     5
+%define                rel     6
 %define                pname   vpb-driver
 Summary:       Voicetronix voice processing board (VPB) driver software
 Summary(pl.UTF-8):     Oprogramowanie sterowników dla kart przetwarzających głos (VPB) Voicetronix
@@ -37,6 +37,7 @@ Patch1:               userspace-only.patch
 Patch2:                linux-4.12.patch
 Patch3:                kernel-4.14.patch
 Patch4:                gcc8.patch
+Patch5:                kernel-5.6.patch
 URL:           http://www.voicetronix.com.au/downloads.htm#linux
 BuildRequires: rpmbuild(macros) >= 1.701
 %{?with_kernel:%{expand:%buildrequires_kernel kernel%%{_alt_kernel}-module-build >= 3:2.6.20.2}}
@@ -149,6 +150,7 @@ p=`pwd`\
 %patch2 -p1
 %patch3 -p1
 %patch4 -p1
+%patch5 -p1
 
 %if %{without kernel}
 %{__sed} -i -e 's,subdirs += $(srcdir)/vtcore $(srcdir)/vpb,,' src/Makefile.in
This page took 0.072349 seconds and 4 git commands to generate.