X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=drivers%2Facpi%2Fosl.c;h=a404ff4d71511d0a9d56ce10a238682e9ffc6073;hb=c8e008e2a6f9ec007a0e22e18eeb5bace5bf16c8;hp=416953a4251094ce2066d724c1d88583b8e89705;hpb=7020bcb82838006e23d058ff07b063b393ed3f10;p=linux.git diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index 416953a42510..a404ff4d7151 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c @@ -76,6 +76,7 @@ static struct workqueue_struct *kacpi_notify_wq; static struct workqueue_struct *kacpi_hotplug_wq; static bool acpi_os_initialized; unsigned int acpi_sci_irq = INVALID_ACPI_IRQ; +bool acpi_permanent_mmap = false; /* * This list of permanent mappings is for memory that may be accessed from @@ -181,15 +182,15 @@ void acpi_os_vprintf(const char *fmt, va_list args) static unsigned long acpi_rsdp; static int __init setup_acpi_rsdp(char *arg) { - if (kstrtoul(arg, 16, &acpi_rsdp)) - return -EINVAL; - return 0; + return kstrtoul(arg, 16, &acpi_rsdp); } early_param("acpi_rsdp", setup_acpi_rsdp); #endif acpi_physical_address __init acpi_os_get_root_pointer(void) { + acpi_physical_address pa = 0; + #ifdef CONFIG_KEXEC if (acpi_rsdp) return acpi_rsdp; @@ -198,21 +199,14 @@ acpi_physical_address __init acpi_os_get_root_pointer(void) if (efi_enabled(EFI_CONFIG_TABLES)) { if (efi.acpi20 != EFI_INVALID_TABLE_ADDR) return efi.acpi20; - else if (efi.acpi != EFI_INVALID_TABLE_ADDR) + if (efi.acpi != EFI_INVALID_TABLE_ADDR) return efi.acpi; - else { - printk(KERN_ERR PREFIX - "System description tables not found\n"); - return 0; - } + pr_err(PREFIX "System description tables not found\n"); } else if (IS_ENABLED(CONFIG_ACPI_LEGACY_TABLES_LOOKUP)) { - acpi_physical_address pa = 0; - acpi_find_root_pointer(&pa); - return pa; } - return 0; + return pa; } /* Must be called with 'acpi_ioremap_lock' or RCU read lock held. */ @@ -313,7 +307,7 @@ static void acpi_unmap(acpi_physical_address pg_off, void __iomem *vaddr) * virtual address). If not found, map it, add it to that list and return a * pointer to it. * - * During early init (when acpi_gbl_permanent_mmap has not been set yet) this + * During early init (when acpi_permanent_mmap has not been set yet) this * routine simply calls __acpi_map_table() to get the job done. */ void __iomem *__ref @@ -329,7 +323,7 @@ acpi_os_map_iomem(acpi_physical_address phys, acpi_size size) return NULL; } - if (!acpi_gbl_permanent_mmap) + if (!acpi_permanent_mmap) return __acpi_map_table((unsigned long)phys, size); mutex_lock(&acpi_ioremap_lock); @@ -399,7 +393,7 @@ static void acpi_os_map_cleanup(struct acpi_ioremap *map) * mappings, drop a reference to it and unmap it if there are no more active * references to it. * - * During early init (when acpi_gbl_permanent_mmap has not been set yet) this + * During early init (when acpi_permanent_mmap has not been set yet) this * routine simply calls __acpi_unmap_table() to get the job done. Since * __acpi_unmap_table() is an __init function, the __ref annotation is needed * here. @@ -408,7 +402,7 @@ void __ref acpi_os_unmap_iomem(void __iomem *virt, acpi_size size) { struct acpi_ioremap *map; - if (!acpi_gbl_permanent_mmap) { + if (!acpi_permanent_mmap) { __acpi_unmap_table(virt, size); return; } @@ -433,12 +427,6 @@ void __ref acpi_os_unmap_memory(void *virt, acpi_size size) } EXPORT_SYMBOL_GPL(acpi_os_unmap_memory); -void __init early_acpi_os_unmap_memory(void __iomem *virt, acpi_size size) -{ - if (!acpi_gbl_permanent_mmap) - __acpi_unmap_table(virt, size); -} - int acpi_os_map_generic_address(struct acpi_generic_address *gas) { u64 addr;