summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPacho Ramos <pacho@gentoo.org>2022-05-27 23:22:23 +0200
committerPacho Ramos <pacho@gentoo.org>2022-05-27 23:23:53 +0200
commit3dd7021076f7c2c94af6ba4311a424beed56c005 (patch)
tree4a2fb01eedfb60965d5682d5c7a7f1b7e872c1bf /sys-power/bbswitch
parentsys-fs/ntfs3g: drop 2021.8.22-r4 (diff)
downloadgentoo-3dd7021076f7c2c94af6ba4311a424beed56c005.tar.gz
gentoo-3dd7021076f7c2c94af6ba4311a424beed56c005.tar.bz2
gentoo-3dd7021076f7c2c94af6ba4311a424beed56c005.zip
sys-power/bbswitch: Fix compat with kernel 5.18
Closes: https://bugs.gentoo.org/847481 Thanks-to: Joe Kappus Signed-off-by: Pacho Ramos <pacho@gentoo.org>
Diffstat (limited to 'sys-power/bbswitch')
-rw-r--r--sys-power/bbswitch/bbswitch-0.8_p20211129.ebuild4
-rw-r--r--sys-power/bbswitch/files/bbswitch-kernel-5.18.patch19
2 files changed, 22 insertions, 1 deletions
diff --git a/sys-power/bbswitch/bbswitch-0.8_p20211129.ebuild b/sys-power/bbswitch/bbswitch-0.8_p20211129.ebuild
index 63147964328f..2aa21af88733 100644
--- a/sys-power/bbswitch/bbswitch-0.8_p20211129.ebuild
+++ b/sys-power/bbswitch/bbswitch-0.8_p20211129.ebuild
@@ -1,7 +1,7 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=7
+EAPI=8
inherit linux-mod toolchain-funcs
@@ -31,6 +31,8 @@ RDEPEND=""
MODULE_NAMES="bbswitch(acpi)"
+PATCHES=( "${FILESDIR}/${PN}-kernel-5.18.patch" )
+
pkg_setup() {
linux-mod_pkg_setup
diff --git a/sys-power/bbswitch/files/bbswitch-kernel-5.18.patch b/sys-power/bbswitch/files/bbswitch-kernel-5.18.patch
new file mode 100644
index 000000000000..07cecd4cdf41
--- /dev/null
+++ b/sys-power/bbswitch/files/bbswitch-kernel-5.18.patch
@@ -0,0 +1,19 @@
+diff -u -r bbswitch-0.8/bbswitch.c bbswitch-0.8-5.18/bbswitch.c
+--- bbswitch-0.8/bbswitch.c 2022-05-24 20:26:22.184553495 +0000
++++ bbswitch-0.8-5.18/bbswitch.c 2022-05-24 20:29:00.797008130 +0000
+@@ -264,10 +264,15 @@
+ pci_disable_device(dis_dev);
+ do {
+ struct acpi_device *ad = NULL;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)
++ ad = acpi_fetch_acpi_dev(dis_handle);
++ if (!ad) {
++#else
+ int r;
+
+ r = acpi_bus_get_device(dis_handle, &ad);
+ if (r || !ad) {
++#endif
+ pr_warn("Cannot get ACPI device for PCI device\n");
+ break;
+ }