summaryrefslogtreecommitdiff
path: root/drivers/platform/x86/intel-rst.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/platform/x86/intel-rst.c')
-rw-r--r--drivers/platform/x86/intel-rst.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/drivers/platform/x86/intel-rst.c b/drivers/platform/x86/intel-rst.c
index d45bca34bf1b..7344d841f4d9 100644
--- a/drivers/platform/x86/intel-rst.c
+++ b/drivers/platform/x86/intel-rst.c
@@ -35,7 +35,7 @@ static ssize_t irst_show_wakeup_events(struct device *dev,
acpi = to_acpi_device(dev);
status = acpi_evaluate_integer(acpi->handle, "GFFS", NULL, &value);
- if (!ACPI_SUCCESS(status))
+ if (ACPI_FAILURE(status))
return -EINVAL;
return sprintf(buf, "%lld\n", value);
@@ -59,7 +59,7 @@ static ssize_t irst_store_wakeup_events(struct device *dev,
status = acpi_execute_simple_method(acpi->handle, "SFFS", value);
- if (!ACPI_SUCCESS(status))
+ if (ACPI_FAILURE(status))
return -EINVAL;
return count;
@@ -81,7 +81,7 @@ static ssize_t irst_show_wakeup_time(struct device *dev,
acpi = to_acpi_device(dev);
status = acpi_evaluate_integer(acpi->handle, "GFTV", NULL, &value);
- if (!ACPI_SUCCESS(status))
+ if (ACPI_FAILURE(status))
return -EINVAL;
return sprintf(buf, "%lld\n", value);
@@ -105,7 +105,7 @@ static ssize_t irst_store_wakeup_time(struct device *dev,
status = acpi_execute_simple_method(acpi->handle, "SFTV", value);
- if (!ACPI_SUCCESS(status))
+ if (ACPI_FAILURE(status))
return -EINVAL;
return count;
@@ -119,21 +119,16 @@ static struct device_attribute irst_timeout_attr = {
static int irst_add(struct acpi_device *acpi)
{
- int error = 0;
+ int error;
error = device_create_file(&acpi->dev, &irst_timeout_attr);
- if (error)
- goto out;
+ if (unlikely(error))
+ return error;
error = device_create_file(&acpi->dev, &irst_wakeup_attr);
- if (error)
- goto out_timeout;
+ if (unlikely(error))
+ device_remove_file(&acpi->dev, &irst_timeout_attr);
- return 0;
-
-out_timeout:
- device_remove_file(&acpi->dev, &irst_timeout_attr);
-out:
return error;
}