diff mbox

acpica: fwts_acpica: remove fwtsInstallLateHandlers

Message ID 1360748142-16267-1-git-send-email-colin.king@canonical.com
State Accepted
Headers show

Commit Message

Colin Ian King Feb. 13, 2013, 9:35 a.m. UTC
From: Colin Ian King <colin.king@canonical.com>

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 <colin.king@canonical.com>
---
 src/acpica/fwts_acpica.c | 43 +++++++++++++------------------------------
 1 file changed, 13 insertions(+), 30 deletions(-)

Comments

Alex Hung Feb. 18, 2013, 3:35 a.m. UTC | #1
On 02/13/2013 05:35 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> 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 <colin.king@canonical.com>
> ---
>   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;
>
>
Acked-by: Alex Hung <alex.hung@canonical.com>
Keng-Yu Lin Feb. 18, 2013, 2:42 p.m. UTC | #2
On Mon, Feb 18, 2013 at 11:35 AM, Alex Hung <alex.hung@canonical.com> wrote:
> On 02/13/2013 05:35 PM, Colin King wrote:
>>
>> From: Colin Ian King <colin.king@canonical.com>
>>
>> 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 <colin.king@canonical.com>
>> ---
>>   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;
>>
>>
> Acked-by: Alex Hung <alex.hung@canonical.com>
>
Acked-by: Keng-Yu Lin <kengyu@canonical.com>
diff mbox

Patch

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;