--- /dev/null
+Index: linux-gpib-kernel/compat/include/linux/device.h
+===================================================================
+--- linux-gpib-kernel/compat/include/linux/device.h (revision 1867)
++++ linux-gpib-kernel/compat/include/linux/device.h (revision 1868)
+@@ -144,4 +144,10 @@
+
+ #endif // LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,3,0)
++#define DRIVER_FIND_DEVICE_DATA_TYPE void *
++#else
++#define DRIVER_FIND_DEVICE_DATA_TYPE const void *
++#endif
++
+ #endif // __COMPAT_LINUX_DEVICE_H_
+Index: linux-gpib-kernel/drivers/gpib/fmh_gpib/fmh_gpib.c
+===================================================================
+--- linux-gpib-kernel/drivers/gpib/fmh_gpib/fmh_gpib.c (revision 1867)
++++ linux-gpib-kernel/drivers/gpib/fmh_gpib/fmh_gpib.c (revision 1868)
+@@ -982,7 +982,7 @@
+ }
+
+ /* Match callback for driver_find_device */
+-static int fmh_gpib_device_match(struct device *dev, void *data)
++static int fmh_gpib_device_match(struct device *dev, DRIVER_FIND_DEVICE_DATA_TYPE data)
+ {
+ const gpib_board_config_t *config = data;
+
+@@ -1014,7 +1014,7 @@
+ struct platform_device *pdev;
+
+ board->dev = driver_find_device(&fmh_gpib_platform_driver.driver,
+- NULL, (void*)config, &fmh_gpib_device_match);
++ NULL, (DRIVER_FIND_DEVICE_DATA_TYPE)config, &fmh_gpib_device_match);
+ if(board->dev == NULL)
+ {
+ printk("No matching fmh_gpib_core device was found, attach failed.");
--- /dev/null
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit linux-info linux-mod toolchain-funcs
+
+DESCRIPTION="Kernel modules for GPIB (IEEE 488.2) hardware"
+HOMEPAGE="https://linux-gpib.sourceforge.io/"
+SRC_URI="mirror://sourceforge/linux-gpib/linux-gpib-${PV}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~x86"
+IUSE="debug"
+
+COMMONDEPEND=""
+RDEPEND="${COMMONDEPEND}
+ !<sci-libs/linux-gpib-4.2.0_rc1
+"
+DEPEND="${COMMONDEPEND}
+ virtual/pkgconfig"
+
+S=${WORKDIR}/linux-gpib-kernel-${PV}
+
+PATCHES=(
+ "${FILESDIR}/${PN}-4.3.0-kernel53.patch"
+)
+
+pkg_setup() {
+ linux-mod_pkg_setup
+
+ if kernel_is -lt 2 6 8; then
+ die "Kernel versions older than 2.6.8 are not supported."
+ fi
+}
+
+src_unpack() {
+ default
+ unpack "${WORKDIR}/linux-gpib-${PV}/linux-gpib-kernel-${PV}.tar.gz"
+}
+
+src_configure() {
+ set_arch_to_kernel
+
+ my_gpib_makeopts=''
+ use debug && my_gpib_makeopts+='GPIB-DEBUG=1 '
+}
+
+src_compile() {
+ set_arch_to_kernel
+ emake \
+ DESTDIR="${D}" \
+ INSTALL_MOD_PATH="${D}" \
+ docdir=/usr/share/doc/${PF}/html \
+ ${my_gpib_makeopts}
+}
+
+src_install() {
+ set_arch_to_kernel
+ emake \
+ DESTDIR="${D}" \
+ INSTALL_MOD_PATH="${D}" \
+ DEPMOD="/bin/true" \
+ docdir=/usr/share/doc/${PF}/html \
+ ${my_gpib_makeopts} \
+ install
+
+ dodoc ChangeLog AUTHORS README* NEWS
+}
+
+pkg_preinst() {
+ linux-mod_pkg_preinst
+ enewgroup gpib
+}
+
+pkg_postinst() {
+ linux-mod_pkg_postinst
+}