Package: vpb-driver
Version: 4.2.61-1.1
Severity: normal
Tags: patch  pending

Dear maintainer,

I've prepared an NMU for vpb-driver (versioned as 4.2.61-1.2) and
uploaded it.

Ben.

-- 
Ben Hutchings
Never attribute to conspiracy what can adequately be explained
by stupidity.
diff -u vpb-driver-4.2.61/debian/changelog vpb-driver-4.2.61/debian/changelog
--- vpb-driver-4.2.61/debian/changelog
+++ vpb-driver-4.2.61/debian/changelog
@@ -1,3 +1,15 @@
+vpb-driver (4.2.61-1.2) unstable; urgency=medium
+
+  * Non-maintainer upload
+  * Use struct proc_ops for proc file operations on Linux 5.6+
+    (Closes: #988564)
+  * Use ioremap() instead of (formerly equivalent, now removed)
+    ioremap_nocache()
+  * Pass target kernel version to depmod (Closes: #917865)
+  * Only run depmod or modprobe if installing modules to host filesystem
+
+ -- Ben Hutchings <b...@debian.org>  Mon, 17 May 2021 00:36:41 +0200
+
 vpb-driver (4.2.61-1.1) unstable; urgency=medium
 
   * Non maintainer upload by the Reproducible Builds team.
only in patch2:
unchanged:
--- vpb-driver-4.2.61.orig/src/vpb/Makefile
+++ vpb-driver-4.2.61/src/vpb/Makefile
@@ -46,7 +46,9 @@
 		echo "installing $$m --> $(MODULEDIR)";	\
 		install -m 644 $$m $(MODULEDIR);	\
 	done
-	/sbin/depmod
+ifeq ($(DESTDIR),)
+	/sbin/depmod $(KVERS)
+endif
 
 clean distclean:
 	$(RM) *.o *.ko *~ core *.mod.c .*.cmd
only in patch2:
unchanged:
--- vpb-driver-4.2.61.orig/src/vpb/vpb.c
+++ vpb-driver-4.2.61/src/vpb/vpb.c
@@ -279,7 +279,7 @@
 			printk(KERN_INFO NAME ": tmp [0x%lx] dev->res2 [0x%lx]\n",
                                               tmp, (unsigned long)dev->resource[2].start);
 
-                        base2[numPCI] = ioremap_nocache(dev->resource[2].start &
+                        base2[numPCI] = ioremap(dev->resource[2].start &
                                                 PCI_BASE_ADDRESS_MEM_MASK,
                                                 sizeof(short)*SIZE_WD);
 
only in patch2:
unchanged:
--- vpb-driver-4.2.61.orig/src/vtcore/Makefile
+++ vpb-driver-4.2.61/src/vtcore/Makefile
@@ -50,8 +50,10 @@
 		echo "installing $$m --> $(MODULEDIR)";	\
 		install -m 644 $$m $(MODULEDIR);	\
 	done
-	/sbin/depmod
+ifeq ($(DESTDIR),)
+	/sbin/depmod $(KVERS)
 	@modprobe -r netjet > /dev/null 2>&1 || true
+endif
 
 clean distclean:
 	rm -f *.o *.ko *~ core *.mod.c .*.cmd
only in patch2:
unchanged:
--- vpb-driver-4.2.61.orig/src/vtcore/vtcore_main.c
+++ vpb-driver-4.2.61/src/vtcore/vtcore_main.c
@@ -213,6 +213,34 @@
 	}
 } //}}}
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)
+#define VT_DEFINE_PROC_OPS(storage, name, _owner, _open, _write)	\
+storage const struct proc_ops name = {					\
+	.proc_open	= _open,					\
+	.proc_read	= seq_read,					\
+	.proc_lseek	= seq_lseek,					\
+	.proc_release	= single_release,				\
+	.proc_write	= _write,					\
+}
+#else  /* LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0) */
+#define VT_DEFINE_PROC_OPS(storage, name, _owner, _open, _write)	\
+storage const struct file_operations name = {				\
+	.owner		= _owner,					\
+	.open		= _open,					\
+	.read		= seq_read,					\
+	.llseek		= seq_lseek,					\
+	.release	= single_release,				\
+	.write		= _write,					\
+}
+#endif
+
+#define VT_DEFINE_PROC_OPS_OPEN(storage, name)				\
+	VT_DEFINE_PROC_OPS(storage, name ## _proc_fops, NULL,		\
+			   name ## _proc_open, NULL)
+
+#define VT_DEFINE_PROC_OPS_OPEN_WRITE(storage, name)			\
+	VT_DEFINE_PROC_OPS(storage, name ## _proc_fops, THIS_MODULE,	\
+			   name ## _proc_open, name ## _proc_write)
 
 static int vt_int_proc_show(struct seq_file *m, void *v)
 { //{{{
@@ -225,12 +253,8 @@
 	return single_open(file, vt_int_proc_show, PDE_DATA(inode));
 }
 
-const struct file_operations vt_int_proc_fops = {
-	.open		= vt_int_proc_open,
-	.read		= seq_read,
-	.llseek		= seq_lseek,
-	.release	= single_release,
-}; //}}}
+VT_DEFINE_PROC_OPS_OPEN(, vt_int);
+//}}}
 
 static int vt_string_proc_show(struct seq_file *m, void *v)
 { //{{{
@@ -243,12 +267,8 @@
 	return single_open(file, vt_string_proc_show, PDE_DATA(inode));
 }
 
-const struct file_operations vt_string_proc_fops = {
-	.open		= vt_string_proc_open,
-	.read		= seq_read,
-	.llseek		= seq_lseek,
-	.release	= single_release,
-}; //}}}
+VT_DEFINE_PROC_OPS_OPEN(, vt_string);
+//}}}
 
 
 int __init vtcore_init(void)
@@ -1081,14 +1101,8 @@
 	return ret;
 }
 
-static const struct file_operations vt_country_proc_fops = {
-	.owner		= THIS_MODULE,
-	.open		= vt_country_proc_open,
-	.read		= seq_read,
-	.llseek		= seq_lseek,
-	.release	= single_release,
-	.write		= vt_country_proc_write,
-}; //}}}
+VT_DEFINE_PROC_OPS_OPEN_WRITE(static, vt_country);
+//}}}
 
 // Template definitions for port ops that communicate a single integer value.
 // {{{
@@ -1161,25 +1175,13 @@
 #define PROC_READ_PORT(attrib)							\
 	PROC_READ_PORT_(attrib)							\
 										\
-static const struct file_operations vt_##attrib##_proc_fops = {			\
-	.open		= vt_##attrib##_proc_open,				\
-	.read		= seq_read,						\
-	.llseek		= seq_lseek,						\
-	.release	= single_release,					\
-};
+VT_DEFINE_PROC_OPS_OPEN(static, vt_##attrib);
 
 #define PROC_READWRITE_PORT(attrib)						\
 	PROC_READ_PORT_(attrib)							\
 	PROC_WRITE_PORT_(attrib)						\
 										\
-static const struct file_operations vt_##attrib##_proc_fops = {			\
-	.owner		= THIS_MODULE,						\
-	.open		= vt_##attrib##_proc_open,				\
-	.read		= seq_read,						\
-	.llseek		= seq_lseek,						\
-	.release	= single_release,					\
-	.write		= vt_##attrib##_proc_write,				\
-};
+VT_DEFINE_PROC_OPS_OPEN_WRITE(static, vt_##attrib);
 //}}}
 
 PROC_READWRITE_PORT(playgain)
only in patch2:
unchanged:
--- vpb-driver-4.2.61.orig/src/vtcore/vtmodule.h
+++ vpb-driver-4.2.61/src/vtcore/vtmodule.h
@@ -9,6 +9,7 @@
 #define __VTMODULE__
 
 #include <linux/cdev.h>
+#include <linux/version.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);
 
-const struct file_operations vt_int_proc_fops;
-const struct file_operations vt_string_proc_fops;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)
+extern const struct proc_ops vt_int_proc_fops;
+extern const struct proc_ops vt_string_proc_fops;
+#else
+extern const struct file_operations vt_int_proc_fops;
+extern const struct file_operations vt_string_proc_fops;
+#endif
 void vt_create_board_proc_const_int(struct vtboard *board, const char *node, long val);
 
 #endif
only in patch2:
unchanged:
--- vpb-driver-4.2.61.orig/src/vtcore/vtopenswitch.c
+++ vpb-driver-4.2.61/src/vtcore/vtopenswitch.c
@@ -1642,8 +1642,8 @@
 	//XXX The new way.
 	//void __iomem * map = pci_iomap(dev, bar, maxbytes);
 
-	card->base0 = ioremap_nocache( pci_resource_start(pdev,0),
-				       pci_resource_len(pdev,0) );
+	card->base0 = ioremap( pci_resource_start(pdev,0),
+			       pci_resource_len(pdev,0) );
 	card->base2 = ioremap( pci_resource_start(pdev,2),
 			       pci_resource_len(pdev,2) );
 

Attachment: signature.asc
Description: PGP signature

Reply via email to