Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 46492ee4 authored by Andy Lutomirski's avatar Andy Lutomirski Committed by Darren Hart (VMware)
Browse files

platform/x86: wmi: Clean up acpi_wmi_add



Rearrange acpi_wmi_add to use Linux's error handling conventions.

Signed-off-by: default avatarAndy Lutomirski <luto@kernel.org>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Mario Limonciello <mario_limonciello@dell.com>
Cc: Pali Rohár <pali.rohar@gmail.com>
Cc: linux-kernel@vger.kernel.org
Cc: platform-driver-x86@vger.kernel.org
Cc: linux-acpi@vger.kernel.org
Acked-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: default avatarDarren Hart (VMware) <dvhart@infradead.org>
parent 7f5809bf
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -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)