commit cbbfd45432f253015ba2ad2d6ad277760c082302
Author: leigh123linux <leigh123linux(a)googlemail.com>
Date: Thu Dec 7 18:12:32 2017 +0000
patch for kernel-4.14
4.14_kernel.patch | 27 +++++++++++++++++++++++++++
nvidia-340xx-kmod.spec | 7 ++++++-
2 files changed, 33 insertions(+), 1 deletion(-)
---
diff --git a/4.14_kernel.patch b/4.14_kernel.patch
new file mode 100644
index 0000000..6c7fb6a
--- /dev/null
+++ b/4.14_kernel.patch
@@ -0,0 +1,27 @@
+--- a/kernel/nv-drm.c
++++ b/kernel/nv-drm.c
+@@ -173,7 +173,11 @@
+ {
+ int ret = 0;
+ #if defined(NV_DRM_AVAILABLE)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0)
++ ret = drm_legacy_pci_init(&nv_drm_driver, pci_driver);
++#else
+ ret = drm_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_legacy_pci_exit(&nv_drm_driver, pci_driver);
++#else
+ drm_pci_exit(&nv_drm_driver, pci_driver);
++#endif
+ #endif
+ }
+
+
diff --git a/nvidia-340xx-kmod.spec b/nvidia-340xx-kmod.spec
index 3ea231c..59cc418 100644
--- a/nvidia-340xx-kmod.spec
+++ b/nvidia-340xx-kmod.spec
@@ -10,7 +10,7 @@ Name: nvidia-340xx-kmod
Epoch: 1
Version: 340.104
# Taken over by kmodtool
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: NVIDIA display driver kernel module
Group: System Environment/Kernel
License: Redistributable, no modification permitted
@@ -19,6 +19,7 @@ URL:
http://www.nvidia.com/
Source11: nvidia-kmodtool-excludekernel-filterfile
Patch0: nv-linux-arm.patch
Patch1: 4.11_kernel.patch
+Patch2: 4.14_kernel.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -48,6 +49,7 @@ tar --use-compress-program xz -xf
%{_datadir}/%{name}-%{version}/%{name}-%{versi
# patch loop
%patch0 -p1
%patch1 -p1
+%patch2 -p1
for kernel_version in %{?kernel_versions} ; do
cp -a kernel _kmod_build_${kernel_version%%___*}
@@ -95,6 +97,9 @@ rm -rf $RPM_BUILD_ROOT
%changelog
+* Thu Dec 07 2017 Leigh Scott <leigh123linux(a)googlemail.com> - 1:340.104-2
+- patch for kernel-4.14
+
* Tue Sep 19 2017 Leigh Scott <leigh123linux(a)googlemail.com> - 1:340.104-1
- Update to 340.104
- Drop obsolete kernel patches