X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=drivers%2Facpi%2Fbus.c;h=fc1110d6a0787a5d2da8e85b0fe3b9e7b15c6fa8;hb=eb9d0fe40e313c0a74115ef456a2e43a6c8da72f;hp=ce3c0a2cbac4dc81e9c5ff2712b100ec8a942b46;hpb=25f666300625d894ebe04bac2b4b3aadb907c861;p=linux-2.6-omap-h63xx.git diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index ce3c0a2cbac..fc1110d6a07 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -35,6 +35,7 @@ #ifdef CONFIG_X86 #include #endif +#include #include #include @@ -294,6 +295,28 @@ int acpi_bus_set_power(acpi_handle handle, int state) EXPORT_SYMBOL(acpi_bus_set_power); +bool acpi_bus_power_manageable(acpi_handle handle) +{ + struct acpi_device *device; + int result; + + result = acpi_bus_get_device(handle, &device); + return result ? false : device->flags.power_manageable; +} + +EXPORT_SYMBOL(acpi_bus_power_manageable); + +bool acpi_bus_can_wakeup(acpi_handle handle) +{ + struct acpi_device *device; + int result; + + result = acpi_bus_get_device(handle, &device); + return result ? false : device->wakeup.flags.valid; +} + +EXPORT_SYMBOL(acpi_bus_can_wakeup); + /* -------------------------------------------------------------------------- Event Management -------------------------------------------------------------------------- */ @@ -373,10 +396,11 @@ int acpi_bus_receive_event(struct acpi_bus_event *event) } spin_lock_irqsave(&acpi_bus_event_lock, flags); - entry = - list_entry(acpi_bus_event_list.next, struct acpi_bus_event, node); - if (entry) + if (!list_empty(&acpi_bus_event_list)) { + entry = list_entry(acpi_bus_event_list.next, + struct acpi_bus_event, node); list_del(&entry->node); + } spin_unlock_irqrestore(&acpi_bus_event_lock, flags); if (!entry) @@ -776,13 +800,14 @@ static int __init acpi_init(void) acpi_kobj = kobject_create_and_add("acpi", firmware_kobj); if (!acpi_kobj) { - printk(KERN_WARNING "%s: kset create error\n", __FUNCTION__); + printk(KERN_WARNING "%s: kset create error\n", __func__); acpi_kobj = NULL; } result = acpi_bus_init(); if (!result) { + pci_mmcfg_late_init(); if (!(pm_flags & PM_APM)) pm_flags |= PM_ACPI; else {