acpi-handle-hack: Linux 3.13 compatibility

Just in case this hack is needed in the future.
hack-lenovo
Peter Wu 11 years ago
parent 81e1e7ee4d
commit 251a7fbec4

@ -81,7 +81,14 @@ static int __init hack_apply(void) {
pr_err("No discrete video card found\n"); pr_err("No discrete video card found\n");
return -ENODEV; return -ENODEV;
} }
#ifdef ACPI_HANDLE
/* since Linux 3.8 */
orig_handle = ACPI_HANDLE(&dis_dev->dev);
#else
/* removed since Linux 3.13 */
orig_handle = DEVICE_ACPI_HANDLE(&dis_dev->dev); orig_handle = DEVICE_ACPI_HANDLE(&dis_dev->dev);
#endif
if (!orig_handle) { if (!orig_handle) {
pr_err("No ACPI handle found for discrete video card\n"); pr_err("No ACPI handle found for discrete video card\n");
goto free_dev; goto free_dev;

Loading…
Cancel
Save