[packages/vpb-driver] - fix building kernel modules for 5.18, rel 9
baggins
baggins at pld-linux.org
Thu May 26 06:54:07 CEST 2022
commit c4534f52db8ff45a515cd8991ceccd3cb997b0f8
Author: Jan Rękorajski <baggins at pld-linux.org>
Date: Thu May 26 06:53:47 2022 +0200
- fix building kernel modules for 5.18, rel 9
kernel-5.18.patch | 46 ++++++++++++++++++++++++++++++++++++++++++++++
vpb-driver.spec | 4 +++-
2 files changed, 49 insertions(+), 1 deletion(-)
---
diff --git a/vpb-driver.spec b/vpb-driver.spec
index 9b3dc40..d37cbe0 100644
--- a/vpb-driver.spec
+++ b/vpb-driver.spec
@@ -21,7 +21,7 @@ exit 1
%define _duplicate_files_terminate_build 0
-%define rel 8
+%define rel 9
%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
@@ -40,6 +40,7 @@ Patch4: gcc8.patch
Patch5: kernel-5.6.patch
Patch6: kernel-5.13.patch
Patch7: kernel-5.17.patch
+Patch8: kernel-5.18.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}}
@@ -155,6 +156,7 @@ p=`pwd`\
%patch5 -p1
%patch6 -p1
%patch7 -p1
+%patch8 -p1
%if %{without kernel}
%{__sed} -i -e 's,subdirs += $(srcdir)/vtcore $(srcdir)/vpb,,' src/Makefile.in
diff --git a/kernel-5.18.patch b/kernel-5.18.patch
new file mode 100644
index 0000000..8ad0064
--- /dev/null
+++ b/kernel-5.18.patch
@@ -0,0 +1,46 @@
+--- vpb-driver-4.2.58/src/vtcore/vtopenpci.c~ 2014-09-28 20:02:28.000000000 +0200
++++ vpb-driver-4.2.58/src/vtcore/vtopenpci.c 2022-05-26 06:49:21.913308375 +0200
+@@ -2414,9 +2414,15 @@
+ goto hell_3;
+ }
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0)
+ card->writeblock = (int *)pci_alloc_consistent(pdev,
+ VT_PCIDMA_BLOCKSIZE,
+ &card->writedma);
++#else
++ card->writeblock = (int *)dma_alloc_coherent(&pdev->dev,
++ VT_PCIDMA_BLOCKSIZE,
++ &card->writedma, GFP_ATOMIC);
++#endif
+ if (!card->writeblock){
+ cardcrit(cardnum, "FAILED to get DMA memory.");
+ goto hell_3;
+@@ -2528,8 +2534,13 @@
+ vtopenpci_board_unregister( card );
+ hell_4:
+ if (card->writeblock){
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0)
+ pci_free_consistent(pdev, VT_PCIDMA_BLOCKSIZE,
+ (void*)card->writeblock, card->writedma);
++#else
++ dma_free_coherent(&pdev->dev, VT_PCIDMA_BLOCKSIZE,
++ (void*)card->writeblock, card->writedma);
++#endif
+ }
+ hell_3:
+ outb(0x00, TJ_CNTL);
+@@ -2600,8 +2611,13 @@
+ vtopenpci_board_unregister( card );
+ outb(0x00, TJ_CNTL);
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0)
+ pci_free_consistent(pdev, VT_PCIDMA_BLOCKSIZE,
+ (void*)card->writeblock, card->writedma);
++#else
++ dma_free_coherent(&pdev->dev, VT_PCIDMA_BLOCKSIZE,
++ (void*)card->writeblock, card->writedma);
++#endif
+ } else {
+ //XXX Do we need to do a forceful hangup here too?
+ if( card->ppdatamask == 0 ) unexport_module_info(card);
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/vpb-driver.git/commitdiff/c4534f52db8ff45a515cd8991ceccd3cb997b0f8
More information about the pld-cvs-commit
mailing list