archrelease: copy trunk to community-x86_64
[ArchLinux/community.git] / bbswitch / trunk / 0003-kernel-5.18.patch
blob07cecd4cdf4195ca3e812c18ac72b6e2cd2b2d4b
1 diff -u -r bbswitch-0.8/bbswitch.c bbswitch-0.8-5.18/bbswitch.c
2 --- bbswitch-0.8/bbswitch.c 2022-05-24 20:26:22.184553495 +0000
3 +++ bbswitch-0.8-5.18/bbswitch.c 2022-05-24 20:29:00.797008130 +0000
4 @@ -264,10 +264,15 @@
5 pci_disable_device(dis_dev);
6 do {
7 struct acpi_device *ad = NULL;
8 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)
9 + ad = acpi_fetch_acpi_dev(dis_handle);
10 + if (!ad) {
11 +#else
12 int r;
14 r = acpi_bus_get_device(dis_handle, &ad);
15 if (r || !ad) {
16 +#endif
17 pr_warn("Cannot get ACPI device for PCI device\n");
18 break;