diff options
author | Axel Lin <axel.lin@ingics.com> | 2016-09-18 21:33:51 -0400 |
---|---|---|
committer | Darren Hart <dvhart@linux.intel.com> | 2016-12-13 12:29:01 -0500 |
commit | 3526ecadc86cc1d485153255498cde7d0275dd37 (patch) | |
tree | 2b46fccd8bda332ae1ca2b9c91e6b28f0114e86e | |
parent | 5dc444b804eae57abaf6f05663d9cb9f030bb9d2 (diff) |
platform/x86: Use ACPI_FAILURE at appropriate places
Use ACPI_FAILURE() to replace !ACPI_SUCCESS(), this avoid !! operations.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
-rw-r--r-- | drivers/platform/x86/intel-hid.c | 6 | ||||
-rw-r--r-- | drivers/platform/x86/intel-smartconnect.c | 2 | ||||
-rw-r--r-- | drivers/platform/x86/intel-vbtn.c | 2 | ||||
-rw-r--r-- | drivers/platform/x86/panasonic-laptop.c | 2 | ||||
-rw-r--r-- | drivers/platform/x86/thinkpad_acpi.c | 2 |
5 files changed, 7 insertions, 7 deletions
diff --git a/drivers/platform/x86/intel-hid.c b/drivers/platform/x86/intel-hid.c index ed5874217ee7..00cbeca2108d 100644 --- a/drivers/platform/x86/intel-hid.c +++ b/drivers/platform/x86/intel-hid.c | |||
@@ -69,7 +69,7 @@ static int intel_hid_set_enable(struct device *device, int enable) | |||
69 | 69 | ||
70 | arg0.integer.value = enable; | 70 | arg0.integer.value = enable; |
71 | status = acpi_evaluate_object(ACPI_HANDLE(device), "HDSM", &args, NULL); | 71 | status = acpi_evaluate_object(ACPI_HANDLE(device), "HDSM", &args, NULL); |
72 | if (!ACPI_SUCCESS(status)) { | 72 | if (ACPI_FAILURE(status)) { |
73 | dev_warn(device, "failed to %sable hotkeys\n", | 73 | dev_warn(device, "failed to %sable hotkeys\n", |
74 | enable ? "en" : "dis"); | 74 | enable ? "en" : "dis"); |
75 | return -EIO; | 75 | return -EIO; |
@@ -148,7 +148,7 @@ static void notify_handler(acpi_handle handle, u32 event, void *context) | |||
148 | } | 148 | } |
149 | 149 | ||
150 | status = acpi_evaluate_integer(handle, "HDEM", NULL, &ev_index); | 150 | status = acpi_evaluate_integer(handle, "HDEM", NULL, &ev_index); |
151 | if (!ACPI_SUCCESS(status)) { | 151 | if (ACPI_FAILURE(status)) { |
152 | dev_warn(&device->dev, "failed to get event index\n"); | 152 | dev_warn(&device->dev, "failed to get event index\n"); |
153 | return; | 153 | return; |
154 | } | 154 | } |
@@ -167,7 +167,7 @@ static int intel_hid_probe(struct platform_device *device) | |||
167 | int err; | 167 | int err; |
168 | 168 | ||
169 | status = acpi_evaluate_integer(handle, "HDMM", NULL, &mode); | 169 | status = acpi_evaluate_integer(handle, "HDMM", NULL, &mode); |
170 | if (!ACPI_SUCCESS(status)) { | 170 | if (ACPI_FAILURE(status)) { |
171 | dev_warn(&device->dev, "failed to read mode\n"); | 171 | dev_warn(&device->dev, "failed to read mode\n"); |
172 | return -ENODEV; | 172 | return -ENODEV; |
173 | } | 173 | } |
diff --git a/drivers/platform/x86/intel-smartconnect.c b/drivers/platform/x86/intel-smartconnect.c index 04cf5dffdfd9..bbe4c06c769f 100644 --- a/drivers/platform/x86/intel-smartconnect.c +++ b/drivers/platform/x86/intel-smartconnect.c | |||
@@ -29,7 +29,7 @@ static int smartconnect_acpi_init(struct acpi_device *acpi) | |||
29 | acpi_status status; | 29 | acpi_status status; |
30 | 30 | ||
31 | status = acpi_evaluate_integer(acpi->handle, "GAOS", NULL, &value); | 31 | status = acpi_evaluate_integer(acpi->handle, "GAOS", NULL, &value); |
32 | if (!ACPI_SUCCESS(status)) | 32 | if (ACPI_FAILURE(status)) |
33 | return -EINVAL; | 33 | return -EINVAL; |
34 | 34 | ||
35 | if (value & 0x1) { | 35 | if (value & 0x1) { |
diff --git a/drivers/platform/x86/intel-vbtn.c b/drivers/platform/x86/intel-vbtn.c index 146d02f8c9bc..f04a394d52d6 100644 --- a/drivers/platform/x86/intel-vbtn.c +++ b/drivers/platform/x86/intel-vbtn.c | |||
@@ -97,7 +97,7 @@ static int intel_vbtn_probe(struct platform_device *device) | |||
97 | int err; | 97 | int err; |
98 | 98 | ||
99 | status = acpi_evaluate_object(handle, "VBDL", NULL, NULL); | 99 | status = acpi_evaluate_object(handle, "VBDL", NULL, NULL); |
100 | if (!ACPI_SUCCESS(status)) { | 100 | if (ACPI_FAILURE(status)) { |
101 | dev_warn(&device->dev, "failed to read Intel Virtual Button driver\n"); | 101 | dev_warn(&device->dev, "failed to read Intel Virtual Button driver\n"); |
102 | return -ENODEV; | 102 | return -ENODEV; |
103 | } | 103 | } |
diff --git a/drivers/platform/x86/panasonic-laptop.c b/drivers/platform/x86/panasonic-laptop.c index 3f870972247c..59b8eb626dcc 100644 --- a/drivers/platform/x86/panasonic-laptop.c +++ b/drivers/platform/x86/panasonic-laptop.c | |||
@@ -458,7 +458,7 @@ static void acpi_pcc_generate_keyinput(struct pcc_acpi *pcc) | |||
458 | 458 | ||
459 | rc = acpi_evaluate_integer(pcc->handle, METHOD_HKEY_QUERY, | 459 | rc = acpi_evaluate_integer(pcc->handle, METHOD_HKEY_QUERY, |
460 | NULL, &result); | 460 | NULL, &result); |
461 | if (!ACPI_SUCCESS(rc)) { | 461 | if (ACPI_FAILURE(rc)) { |
462 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, | 462 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, |
463 | "error getting hotkey status\n")); | 463 | "error getting hotkey status\n")); |
464 | return; | 464 | return; |
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index b65ce7519411..31fb979b1bfe 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c | |||
@@ -9018,7 +9018,7 @@ static int mute_led_on_off(struct tp_led_table *t, bool state) | |||
9018 | acpi_handle temp; | 9018 | acpi_handle temp; |
9019 | int output; | 9019 | int output; |
9020 | 9020 | ||
9021 | if (!ACPI_SUCCESS(acpi_get_handle(hkey_handle, t->name, &temp))) { | 9021 | if (ACPI_FAILURE(acpi_get_handle(hkey_handle, t->name, &temp))) { |
9022 | pr_warn("Thinkpad ACPI has no %s interface.\n", t->name); | 9022 | pr_warn("Thinkpad ACPI has no %s interface.\n", t->name); |
9023 | return -EIO; | 9023 | return -EIO; |
9024 | } | 9024 | } |