aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/acpi/acpica/hwxface.c18
-rw-r--r--include/acpi/acexcep.h6
2 files changed, 12 insertions, 12 deletions
diff --git a/drivers/acpi/acpica/hwxface.c b/drivers/acpi/acpica/hwxface.c
index ae597c0ab53f..f67562ea0010 100644
--- a/drivers/acpi/acpica/hwxface.c
+++ b/drivers/acpi/acpica/hwxface.c
@@ -107,19 +107,18 @@ acpi_status acpi_read(u32 *value, struct acpi_generic_address *reg)
107 ACPI_FUNCTION_NAME(acpi_read); 107 ACPI_FUNCTION_NAME(acpi_read);
108 108
109 /* 109 /*
110 * Must have a valid pointer to a GAS structure, and 110 * Must have a valid pointer to a GAS structure, and a non-zero address
111 * a non-zero address within. However, don't return an error 111 * within.
112 * because the PM1A/B code must not fail if B isn't present.
113 */ 112 */
114 if (!reg) { 113 if (!reg) {
115 return (AE_OK); 114 return (AE_BAD_PARAMETER);
116 } 115 }
117 116
118 /* Get a local copy of the address. Handles possible alignment issues */ 117 /* Get a local copy of the address. Handles possible alignment issues */
119 118
120 ACPI_MOVE_64_TO_64(&address, &reg->address); 119 ACPI_MOVE_64_TO_64(&address, &reg->address);
121 if (!address) { 120 if (!address) {
122 return (AE_OK); 121 return (AE_BAD_ADDRESS);
123 } 122 }
124 123
125 /* Supported widths are 8/16/32 */ 124 /* Supported widths are 8/16/32 */
@@ -187,19 +186,18 @@ acpi_status acpi_write(u32 value, struct acpi_generic_address *reg)
187 ACPI_FUNCTION_NAME(acpi_write); 186 ACPI_FUNCTION_NAME(acpi_write);
188 187
189 /* 188 /*
190 * Must have a valid pointer to a GAS structure, and 189 * Must have a valid pointer to a GAS structure, and a non-zero address
191 * a non-zero address within. However, don't return an error 190 * within.
192 * because the PM1A/B code must not fail if B isn't present.
193 */ 191 */
194 if (!reg) { 192 if (!reg) {
195 return (AE_OK); 193 return (AE_BAD_PARAMETER);
196 } 194 }
197 195
198 /* Get a local copy of the address. Handles possible alignment issues */ 196 /* Get a local copy of the address. Handles possible alignment issues */
199 197
200 ACPI_MOVE_64_TO_64(&address, &reg->address); 198 ACPI_MOVE_64_TO_64(&address, &reg->address);
201 if (!address) { 199 if (!address) {
202 return (AE_OK); 200 return (AE_BAD_ADDRESS);
203 } 201 }
204 202
205 /* Supported widths are 8/16/32 */ 203 /* Supported widths are 8/16/32 */
diff --git a/include/acpi/acexcep.h b/include/acpi/acexcep.h
index eda04546cdf6..473d584b1d31 100644
--- a/include/acpi/acexcep.h
+++ b/include/acpi/acexcep.h
@@ -103,8 +103,9 @@
103#define AE_BAD_OCTAL_CONSTANT (acpi_status) (0x0006 | AE_CODE_PROGRAMMER) 103#define AE_BAD_OCTAL_CONSTANT (acpi_status) (0x0006 | AE_CODE_PROGRAMMER)
104#define AE_BAD_DECIMAL_CONSTANT (acpi_status) (0x0007 | AE_CODE_PROGRAMMER) 104#define AE_BAD_DECIMAL_CONSTANT (acpi_status) (0x0007 | AE_CODE_PROGRAMMER)
105#define AE_MISSING_ARGUMENTS (acpi_status) (0x0008 | AE_CODE_PROGRAMMER) 105#define AE_MISSING_ARGUMENTS (acpi_status) (0x0008 | AE_CODE_PROGRAMMER)
106#define AE_BAD_ADDRESS (acpi_status) (0x0009 | AE_CODE_PROGRAMMER)
106 107
107#define AE_CODE_PGM_MAX 0x0008 108#define AE_CODE_PGM_MAX 0x0009
108 109
109/* 110/*
110 * Acpi table exceptions 111 * Acpi table exceptions
@@ -224,7 +225,8 @@ char const *acpi_gbl_exception_names_pgm[] = {
224 "AE_BAD_HEX_CONSTANT", 225 "AE_BAD_HEX_CONSTANT",
225 "AE_BAD_OCTAL_CONSTANT", 226 "AE_BAD_OCTAL_CONSTANT",
226 "AE_BAD_DECIMAL_CONSTANT", 227 "AE_BAD_DECIMAL_CONSTANT",
227 "AE_MISSING_ARGUMENTS" 228 "AE_MISSING_ARGUMENTS",
229 "AE_BAD_ADDRESS"
228}; 230};
229 231
230char const *acpi_gbl_exception_names_tbl[] = { 232char const *acpi_gbl_exception_names_tbl[] = {