From patchwork Wed Feb 13 09:35:42 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Ian King X-Patchwork-Id: 220099 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id 8D4BD2C0092 for ; Wed, 13 Feb 2013 20:35:46 +1100 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1U5Ykj-0000X3-88; Wed, 13 Feb 2013 09:35:45 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1U5Ykg-0000W1-L6 for fwts-devel@lists.ubuntu.com; Wed, 13 Feb 2013 09:35:42 +0000 Received: from cpc3-craw6-2-0-cust180.croy.cable.virginmedia.com ([77.100.248.181] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1U5Ykg-0004oW-I8 for fwts-devel@lists.ubuntu.com; Wed, 13 Feb 2013 09:35:42 +0000 From: Colin King To: fwts-devel@lists.ubuntu.com Subject: [PATCH] acpica: fwts_acpica: remove fwtsInstallLateHandlers Date: Wed, 13 Feb 2013 09:35:42 +0000 Message-Id: <1360748142-16267-1-git-send-email-colin.king@canonical.com> X-Mailer: git-send-email 1.8.1.2 X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.13 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: fwts-devel-bounces@lists.ubuntu.com Errors-To: fwts-devel-bounces@lists.ubuntu.com From: Colin Ian King Move fixed event handler init to fwtsInstallEarlyHandlers and remove the duplicated AcpiInstallAddressSpaceHandler installs. This ends up with an empty fwtsInstallLateHandlers which means we can remove this function altogther. This slight change removes the unsightly ACPI initialisation warnings. Signed-off-by: Colin Ian King Acked-by: Alex Hung Acked-by: Keng-Yu Lin --- src/acpica/fwts_acpica.c | 43 +++++++++++++------------------------------ 1 file changed, 13 insertions(+), 30 deletions(-) diff --git a/src/acpica/fwts_acpica.c b/src/acpica/fwts_acpica.c index 65caa18..b9c8839 100644 --- a/src/acpica/fwts_acpica.c +++ b/src/acpica/fwts_acpica.c @@ -779,35 +779,6 @@ void AcpiOsSleep(UINT64 milliseconds) { } -int fwtsInstallLateHandlers(fwts_framework *fw) -{ - int i; - - if (!AcpiGbl_ReducedHardware) { - if (AcpiInstallFixedEventHandler(ACPI_EVENT_GLOBAL, fwts_event_handler, NULL) != AE_OK) { - fwts_log_error(fw, "Failed to install global event handler."); - return FWTS_ERROR; - } - if (AcpiInstallFixedEventHandler(ACPI_EVENT_RTC, fwts_event_handler, NULL) != AE_OK) { - fwts_log_error(fw, "Failed to install RTC event handler."); - return FWTS_ERROR; - } - } - - for (i = 0; i < ACPI_ARRAY_LENGTH(fwts_space_id_list); i++) { - if (AcpiInstallAddressSpaceHandler(AcpiGbl_RootNode, - fwts_space_id_list[i], fwts_region_handler, fwts_region_init, NULL) != AE_OK) { - fwts_log_error(fw, - "Failed to install handler for %s space(%u)", - AcpiUtGetRegionName((UINT8)fwts_space_id_list[i]), - fwts_space_id_list[i]); - return FWTS_ERROR; - } - } - - return FWTS_OK; -} - int fwtsInstallEarlyHandlers(fwts_framework *fw) { int i; @@ -889,6 +860,18 @@ int fwtsInstallEarlyHandlers(fwts_framework *fw) return FWTS_ERROR; } } + + if (!AcpiGbl_ReducedHardware) { + if (AcpiInstallFixedEventHandler(ACPI_EVENT_GLOBAL, fwts_event_handler, NULL) != AE_OK) { + fwts_log_error(fw, "Failed to install global event handler."); + return FWTS_ERROR; + } + if (AcpiInstallFixedEventHandler(ACPI_EVENT_RTC, fwts_event_handler, NULL) != AE_OK) { + fwts_log_error(fw, "Failed to install RTC event handler."); + return FWTS_ERROR; + } + } + return FWTS_OK; } @@ -918,6 +901,7 @@ int fwts_acpica_init(fwts_framework *fw) AcpiOsRedirectOutput(stderr); + if (ACPI_FAILURE(AcpiInitializeSubsystem())) { fwts_log_error(fw, "Failed to initialise ACPICA subsystem."); return FWTS_ERROR; @@ -1074,7 +1058,6 @@ int fwts_acpica_init(fwts_framework *fw) (void)fwtsInstallEarlyHandlers(fw); AcpiEnableSubsystem(init_flags); AcpiInitializeObjects(init_flags); - (void)fwtsInstallLateHandlers(fw); fwts_acpica_init_called = true;