Gentoo Archives: gentoo-commits

From: Pacho Ramos <pacho@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-power/bbswitch/files/, sys-power/bbswitch/
Date: Fri, 27 May 2022 21:24:06
Message-Id: 1653686633.3dd7021076f7c2c94af6ba4311a424beed56c005.pacho@gentoo
1 commit: 3dd7021076f7c2c94af6ba4311a424beed56c005
2 Author: Pacho Ramos <pacho <AT> gentoo <DOT> org>
3 AuthorDate: Fri May 27 21:22:23 2022 +0000
4 Commit: Pacho Ramos <pacho <AT> gentoo <DOT> org>
5 CommitDate: Fri May 27 21:23:53 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3dd70210
7
8 sys-power/bbswitch: Fix compat with kernel 5.18
9
10 Closes: https://bugs.gentoo.org/847481
11 Thanks-to: Joe Kappus
12 Signed-off-by: Pacho Ramos <pacho <AT> gentoo.org>
13
14 sys-power/bbswitch/bbswitch-0.8_p20211129.ebuild | 4 +++-
15 sys-power/bbswitch/files/bbswitch-kernel-5.18.patch | 19 +++++++++++++++++++
16 2 files changed, 22 insertions(+), 1 deletion(-)
17
18 diff --git a/sys-power/bbswitch/bbswitch-0.8_p20211129.ebuild b/sys-power/bbswitch/bbswitch-0.8_p20211129.ebuild
19 index 63147964328f..2aa21af88733 100644
20 --- a/sys-power/bbswitch/bbswitch-0.8_p20211129.ebuild
21 +++ b/sys-power/bbswitch/bbswitch-0.8_p20211129.ebuild
22 @@ -1,7 +1,7 @@
23 # Copyright 1999-2022 Gentoo Authors
24 # Distributed under the terms of the GNU General Public License v2
25
26 -EAPI=7
27 +EAPI=8
28
29 inherit linux-mod toolchain-funcs
30
31 @@ -31,6 +31,8 @@ RDEPEND=""
32
33 MODULE_NAMES="bbswitch(acpi)"
34
35 +PATCHES=( "${FILESDIR}/${PN}-kernel-5.18.patch" )
36 +
37 pkg_setup() {
38 linux-mod_pkg_setup
39
40
41 diff --git a/sys-power/bbswitch/files/bbswitch-kernel-5.18.patch b/sys-power/bbswitch/files/bbswitch-kernel-5.18.patch
42 new file mode 100644
43 index 000000000000..07cecd4cdf41
44 --- /dev/null
45 +++ b/sys-power/bbswitch/files/bbswitch-kernel-5.18.patch
46 @@ -0,0 +1,19 @@
47 +diff -u -r bbswitch-0.8/bbswitch.c bbswitch-0.8-5.18/bbswitch.c
48 +--- bbswitch-0.8/bbswitch.c 2022-05-24 20:26:22.184553495 +0000
49 ++++ bbswitch-0.8-5.18/bbswitch.c 2022-05-24 20:29:00.797008130 +0000
50 +@@ -264,10 +264,15 @@
51 + pci_disable_device(dis_dev);
52 + do {
53 + struct acpi_device *ad = NULL;
54 ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)
55 ++ ad = acpi_fetch_acpi_dev(dis_handle);
56 ++ if (!ad) {
57 ++#else
58 + int r;
59 +
60 + r = acpi_bus_get_device(dis_handle, &ad);
61 + if (r || !ad) {
62 ++#endif
63 + pr_warn("Cannot get ACPI device for PCI device\n");
64 + break;
65 + }