[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <f6afef556cadd0d6976e78754207cf74000b12e2.1495862272.git.dvhart@infradead.org>
Date: Fri, 26 May 2017 22:31:17 -0700
From: Darren Hart <dvhart@...radead.org>
To: platform-driver-x86@...r.kernel.org
Cc: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Andy Lutomirski <luto@...nel.org>,
Andy Lutomirski <luto@...capital.net>,
Mario Limonciello <mario_limonciello@...l.com>,
Pali Rohár <pali.rohar@...il.com>,
Rafael Wysocki <rjw@...ysocki.net>,
linux-kernel@...r.kernel.org, linux-acpi@...r.kernel.org,
Darren Hart <dvhart@...radead.org>
Subject: [PATCH 03/16] platform/x86: wmi: Clean up acpi_wmi_add
From: Andy Lutomirski <luto@...nel.org>
Rearrange acpi_wmi_add to use Linux's error handling conventions.
Signed-off-by: Andy Lutomirski <luto@...nel.org>
Cc: Andy Lutomirski <luto@...capital.net>
Cc: Mario Limonciello <mario_limonciello@...l.com>
Cc: Pali Rohár <pali.rohar@...il.com>
Cc: Rafael Wysocki <rjw@...ysocki.net>
Cc: linux-kernel@...r.kernel.org
Cc: platform-driver-x86@...r.kernel.org
Cc: linux-acpi@...r.kernel.org
Signed-off-by: Darren Hart (VMware) <dvhart@...radead.org>
---
drivers/platform/x86/wmi.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c
index c6e11b5..ac60a51 100644
--- a/drivers/platform/x86/wmi.c
+++ b/drivers/platform/x86/wmi.c
@@ -803,20 +803,24 @@ static int acpi_wmi_add(struct acpi_device *device)
&acpi_wmi_ec_space_handler,
NULL, NULL);
if (ACPI_FAILURE(status)) {
- pr_err("Error installing EC region handler\n");
+ dev_err(&device->dev, "Error installing EC region handler\n");
return -ENODEV;
}
error = parse_wdg(device);
if (error) {
- acpi_remove_address_space_handler(device->handle,
- ACPI_ADR_SPACE_EC,
- &acpi_wmi_ec_space_handler);
pr_err("Failed to parse WDG method\n");
- return error;
+ goto err_remove_handler;
}
return 0;
+
+err_remove_handler:
+ acpi_remove_address_space_handler(device->handle,
+ ACPI_ADR_SPACE_EC,
+ &acpi_wmi_ec_space_handler);
+
+ return error;
}
static int __init acpi_wmi_init(void)
--
2.9.4
Powered by blists - more mailing lists