From: Jan Rękorajski Date: Mon, 6 Apr 2020 21:13:52 +0000 (+0200) Subject: - fix building kernel module for linux 5.6 X-Git-Tag: auto/th/linux-gpib-4.3.0-6 X-Git-Url: https://git.pld-linux.org/?p=packages%2Flinux-gpib.git;a=commitdiff_plain;h=b323fda487b6af70cd936b2ef6ef5a8511f4cfe9 - fix building kernel module for linux 5.6 - rel 6 --- diff --git a/kernel-5.6.patch b/kernel-5.6.patch new file mode 100644 index 0000000..ef91349 --- /dev/null +++ b/kernel-5.6.patch @@ -0,0 +1,79 @@ +Index: linux-gpib-kernel/drivers/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c +=================================================================== +--- linux-gpib-kernel/drivers/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c (revision 1864) ++++ linux-gpib-kernel/drivers/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c (revision 1865) +@@ -100,6 +100,7 @@ + + #define INBUF_SIZE 128 + ++ + struct char_buf { /* used by one_char() routine */ + char * inbuf; + int last; +@@ -110,7 +111,7 @@ + struct file * f; /* the 'file' structure for the tty-usb line */ + uint8_t eos; /* eos character */ + short eos_flags; /* eos mode */ +- struct timespec before ; /* time value for timings */ ++ struct timespec64 before ; /* time value for timings */ + int timeout; /* current value for timeout */ + } usb_gpib_private_t; + +@@ -188,7 +189,7 @@ + * (unix time in sec and NANOsec) + */ + +-inline int usec_diff (struct timespec * a, struct timespec * b) { ++inline int usec_diff (struct timespec64 * a, struct timespec64 * b) { + return ((a->tv_sec - b->tv_sec)*1000000 + + (a->tv_nsec - b->tv_nsec)/1000); + } +@@ -302,7 +303,7 @@ + + static int one_char(gpib_board_t *board, struct char_buf * b) { + +- struct timespec before, after; ++ struct timespec64 before, after; + struct file *f = ((usb_gpib_private_t *)board->private_data)->f; + + if (b->nchar) { +@@ -309,10 +310,10 @@ + DIA_LOG ("-> %x\n", b->inbuf[b->last - b->nchar]); + return b->inbuf[b->last - b->nchar--]; + } +- getnstimeofday (&before); ++ ktime_get_real_ts64 (&before); + b->last = b->nchar = + f->f_op->read (f, b->inbuf, INBUF_SIZE, &f->f_pos); +- getnstimeofday (&after); ++ ktime_get_real_ts64 (&after); + + DIA_LOG ("read %d bytes in %d usec\n", + b->nchar, usec_diff(&after, &before)); +@@ -721,7 +722,7 @@ + int retval; + mm_segment_t oldfs; + char c; +- struct timespec before, after; ++ struct timespec64 before, after; + int read_count = MAX_READ_EXCESS; + usb_gpib_private_t * pd = (usb_gpib_private_t *)board->private_data; + +@@ -743,7 +744,7 @@ + oldfs = get_fs(); + set_fs (KERNEL_DS); + +- getnstimeofday (&before); ++ ktime_get_real_ts64 (&before); + + if (write_loop (pd->f, USB_GPIB_READ_1, + strlen(USB_GPIB_READ_1)) == -EIO) { +@@ -755,7 +756,7 @@ + &pd->f->f_pos); + retval += pd->f->f_op->read (pd->f, inbuf+1, 1, + &pd->f->f_pos); +- getnstimeofday (&after); ++ ktime_get_real_ts64 (&after); + + set_fs (oldfs); + diff --git a/linux-gpib.spec b/linux-gpib.spec index 4bd0174..0e4073e 100644 --- a/linux-gpib.spec +++ b/linux-gpib.spec @@ -32,7 +32,7 @@ exit 1 %define php_name php%{?php_suffix} -%define rel 5 +%define rel 6 %define pname linux-gpib Summary: GPIB (IEEE 488) Linux support Summary(pl.UTF-8): Obsługa GPIB (IEEE 488) dla Linuksa @@ -49,6 +49,7 @@ Patch4: %{pname}-firmwaredir.patch Patch5: %{pname}-guile2.patch Patch6: %{pname}-php7.patch Patch8: kernel-5.2.patch +Patch9: kernel-5.6.patch URL: http://linux-gpib.sourceforge.net/ BuildRequires: autoconf >= 2.50 BuildRequires: automake @@ -270,6 +271,7 @@ cd linux-gpib-kernel-%{version} %ifarch %{ix86} %patch8 -p1 %endif +%patch9 -p1 %endif %build