nvidia340: fix building with linux4.14 (#9228)

renames drm_pci_init to drm_legacy_pci_init in the driver, the function
has been deprecated and renamed in
10631d724d .
Original patch written by MilhouseVH via
https://github.com/LibreELEC/LibreELEC.tv/blob/master/packages/x11/driver/xf86-video-nvidia-legacy/patches/xf86-video-nvidia-legacy-0010-kernel-4.14.patch .
This commit is contained in:
Helmut Pozimski 2017-11-16 10:32:46 +01:00 committed by Juan RP
parent 59478d91bc
commit 35743be687
2 changed files with 28 additions and 1 deletions

View file

@ -0,0 +1,26 @@
--- kernel/nv-drm.c.orig 2017-11-15 21:28:26.896689841 +0100
+++ kernel/nv-drm.c 2017-11-15 21:31:01.579707509 +0100
@@ -173,7 +173,11 @@
{
int ret = 0;
#if defined(NV_DRM_AVAILABLE)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0)
ret = drm_pci_init(&nv_drm_driver, pci_driver);
+#else
+ ret = drm_legacy_pci_init(&nv_drm_driver, pci_driver);
+#endif
#endif
return ret;
}
@@ -183,7 +187,11 @@
)
{
#if defined(NV_DRM_AVAILABLE)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0)
drm_pci_exit(&nv_drm_driver, pci_driver);
+#else
+ drm_legacy_pci_exit(&nv_drm_driver, pci_driver);
+#endif
#endif
}

View file

@ -4,7 +4,7 @@ _desc="NVIDIA drivers (GeForce 8, 9, 9M, 100, 100M, 200, 300 series)"
pkgname=nvidia340
version=340.104
revision=2
revision=3
maintainer="Juan RP <xtraeme@voidlinux.eu>"
license="Proprietary NVIDIA license"
homepage="http://www.nvidia.com"
@ -41,6 +41,7 @@ do_extract() {
do_configure() {
cd ${_pkg}
patch -p0 < ${FILESDIR}/kernel-4.11.patch
patch -p0 < ${FILESDIR}/kernel-4.14.patch
}
do_install() {