From adec1ec2bb58152ff2b79c15c3499e0a9786a3f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Sat, 9 Jul 2022 22:31:16 +0700 Subject: [PATCH] bbswitch: add patch for linux 5.18 Close #37916 --- .../bbswitch/patches/0003-kernel-5.18.patch | 18 ++++++++++++++++++ srcpkgs/bbswitch/template | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/bbswitch/patches/0003-kernel-5.18.patch diff --git a/srcpkgs/bbswitch/patches/0003-kernel-5.18.patch b/srcpkgs/bbswitch/patches/0003-kernel-5.18.patch new file mode 100644 index 00000000000000..6fa0e58269d98f --- /dev/null +++ b/srcpkgs/bbswitch/patches/0003-kernel-5.18.patch @@ -0,0 +1,18 @@ +--- a/bbswitch.c ++++ b/bbswitch.c +@@ -264,10 +264,14 @@ + pci_disable_device(dis_dev); + do { + struct acpi_device *ad = NULL; +- int r; ++ int r = 0; + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0) ++ ad = acpi_fetch_acpi_dev(dis_handle); ++#else + r = acpi_bus_get_device(dis_handle, &ad); ++#endif + if (r || !ad) { + pr_warn("Cannot get ACPI device for PCI device\n"); + break; + } diff --git a/srcpkgs/bbswitch/template b/srcpkgs/bbswitch/template index 4dc9d3235e60bb..bc0a54ceb2c58d 100644 --- a/srcpkgs/bbswitch/template +++ b/srcpkgs/bbswitch/template @@ -1,7 +1,7 @@ # Template file for 'bbswitch' pkgname=bbswitch version=0.8 -revision=4 +revision=5 archs="x86_64*" depends="dkms" short_desc="Kernel module for disabling the nVidia GPU on Optimus laptops"