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

Commit 557b4549 authored by Frans Klaver's avatar Frans Klaver Committed by Darren Hart
Browse files

eeepc-laptop: clean up control flow in *_rfkill_notifier



Handle errors immediately in eeepc_register_rfkill_notifier and
eeepc_unregister_rfkill_notifier. This clears up the control flow for the
reader. It also removes unnecessary indentation.

Signed-off-by: default avatarFrans Klaver <fransklaver@gmail.com>
Signed-off-by: default avatarDarren Hart <dvhart@linux.intel.com>
parent d4869038
Loading
Loading
Loading
Loading
+28 −29
Original line number Diff line number Diff line
@@ -668,7 +668,9 @@ static int eeepc_register_rfkill_notifier(struct eeepc_laptop *eeepc,

	status = acpi_get_handle(NULL, node, &handle);

	if (ACPI_SUCCESS(status)) {
	if (ACPI_FAILURE(status))
		return -ENODEV;

	status = acpi_install_notify_handler(handle,
					     ACPI_SYSTEM_NOTIFY,
					     eeepc_rfkill_notify,
@@ -681,10 +683,6 @@ static int eeepc_register_rfkill_notifier(struct eeepc_laptop *eeepc,
	 * changed during setup.
	 */
	eeepc_rfkill_hotplug(eeepc, handle);
	} else {
		return -ENODEV;
	}

	return 0;
}

@@ -696,7 +694,9 @@ static void eeepc_unregister_rfkill_notifier(struct eeepc_laptop *eeepc,

	status = acpi_get_handle(NULL, node, &handle);

	if (ACPI_SUCCESS(status)) {
	if (ACPI_FAILURE(status))
		return;

	status = acpi_remove_notify_handler(handle,
					     ACPI_SYSTEM_NOTIFY,
					     eeepc_rfkill_notify);
@@ -710,7 +710,6 @@ static void eeepc_unregister_rfkill_notifier(struct eeepc_laptop *eeepc,
		 */
	eeepc_rfkill_hotplug(eeepc, handle);
}
}

static int eeepc_get_adapter_status(struct hotplug_slot *hotplug_slot,
				    u8 *value)