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

Commit dac670b9 authored by Johan Hedberg's avatar Johan Hedberg Committed by Gustavo Padovan
Browse files

Bluetooth: Simplify hci_uart_tty_close logic



This patch cleans up and reduces indentation in the hci_uart_tty_close
function.

Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
Signed-off-by: default avatarGustavo Padovan <gustavo.padovan@collabora.co.uk>
parent 40f10224
Loading
Loading
Loading
Loading
+13 −12
Original line number Original line Diff line number Diff line
@@ -286,15 +286,17 @@ static int hci_uart_tty_open(struct tty_struct *tty)
static void hci_uart_tty_close(struct tty_struct *tty)
static void hci_uart_tty_close(struct tty_struct *tty)
{
{
	struct hci_uart *hu = (void *)tty->disc_data;
	struct hci_uart *hu = (void *)tty->disc_data;
	struct hci_dev *hdev;


	BT_DBG("tty %p", tty);
	BT_DBG("tty %p", tty);


	/* Detach from the tty */
	/* Detach from the tty */
	tty->disc_data = NULL;
	tty->disc_data = NULL;


	if (hu) {
	if (!hu)
		struct hci_dev *hdev = hu->hdev;
		return;


	hdev = hu->hdev;
	if (hdev)
	if (hdev)
		hci_uart_close(hdev);
		hci_uart_close(hdev);


@@ -308,7 +310,6 @@ static void hci_uart_tty_close(struct tty_struct *tty)


	kfree(hu);
	kfree(hu);
}
}
}


/* hci_uart_tty_wakeup()
/* hci_uart_tty_wakeup()
 *
 *