From 3dd7021076f7c2c94af6ba4311a424beed56c005 Mon Sep 17 00:00:00 2001 From: Pacho Ramos Date: Fri, 27 May 2022 23:22:23 +0200 Subject: sys-power/bbswitch: Fix compat with kernel 5.18 Closes: https://bugs.gentoo.org/847481 Thanks-to: Joe Kappus Signed-off-by: Pacho Ramos --- sys-power/bbswitch/bbswitch-0.8_p20211129.ebuild | 4 +++- sys-power/bbswitch/files/bbswitch-kernel-5.18.patch | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 sys-power/bbswitch/files/bbswitch-kernel-5.18.patch (limited to 'sys-power/bbswitch') 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; + } -- cgit v1.2.3-65-gdbad