Bluetooth: Simplify bt_hci_connect_le_cancel

There is no need for local variabel as error code can be returned
directly.

Change-Id: I0ad1bccb75bf1897d210c12d3ad0108f1f909dbe
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
This commit is contained in:
Szymon Janc 2016-06-07 13:25:15 +02:00
commit c443888f3d

View file

@ -1265,8 +1265,6 @@ static int bt_hci_disconnect(struct bt_conn *conn, uint8_t reason)
static int bt_hci_connect_le_cancel(struct bt_conn *conn) static int bt_hci_connect_le_cancel(struct bt_conn *conn)
{ {
int err;
if (conn->timeout) { if (conn->timeout) {
fiber_delayed_start_cancel(conn->timeout); fiber_delayed_start_cancel(conn->timeout);
conn->timeout = NULL; conn->timeout = NULL;
@ -1275,12 +1273,7 @@ static int bt_hci_connect_le_cancel(struct bt_conn *conn)
bt_conn_unref(conn); bt_conn_unref(conn);
} }
err = bt_hci_cmd_send(BT_HCI_OP_LE_CREATE_CONN_CANCEL, NULL); return bt_hci_cmd_send(BT_HCI_OP_LE_CREATE_CONN_CANCEL, NULL);
if (err) {
return err;
}
return 0;
} }
int bt_conn_le_param_update(struct bt_conn *conn, int bt_conn_le_param_update(struct bt_conn *conn,