From 417a592331fb42c88bd7a102968fdc0255e5cf22 Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Thu, 5 Dec 2013 00:17:10 +0100 Subject: [PATCH] Linux 3.13 compatibility Reported by ArchangeGabriel, original patch by tuxoko (Issue Bumblebee-Project/bbswitch#75) --- bbswitch.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bbswitch.c b/bbswitch.c index 30fbf94..5e2b98f 100644 --- a/bbswitch.c +++ b/bbswitch.c @@ -403,7 +403,13 @@ static int __init bbswitch_init(void) { pci_class != PCI_CLASS_DISPLAY_3D) continue; +#ifdef ACPI_HANDLE + /* since Linux 3.8 */ + handle = ACPI_HANDLE(&pdev->dev); +#else + /* removed since Linux 3.13 */ handle = DEVICE_ACPI_HANDLE(&pdev->dev); +#endif if (!handle) { pr_warn("cannot find ACPI handle for VGA device %s\n", dev_name(&pdev->dev));