Skip to content

Commit a2b1976

Browse files
committed
Bluetooth: Remove reason parameter from hci_amp_disconn function
The hci_amp_disconn function is a local function and there is no need for a reason parameter. That one can be retrieved from the hci_conn object easily. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
1 parent b10e801 commit a2b1976

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

‎net/bluetooth/hci_conn.c‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ void hci_disconnect(struct hci_conn *conn, __u8 reason)
136136
hci_send_cmd(conn->hdev, HCI_OP_DISCONNECT, sizeof(cp), &cp);
137137
}
138138

139-
static void hci_amp_disconn(struct hci_conn *conn, __u8 reason)
139+
static void hci_amp_disconn(struct hci_conn *conn)
140140
{
141141
struct hci_cp_disconn_phy_link cp;
142142

@@ -145,7 +145,7 @@ static void hci_amp_disconn(struct hci_conn *conn, __u8 reason)
145145
conn->state = BT_DISCONN;
146146

147147
cp.phy_handle = HCI_PHY_HANDLE(conn->handle);
148-
cp.reason = reason;
148+
cp.reason = hci_proto_disconn_ind(conn);
149149
hci_send_cmd(conn->hdev, HCI_OP_DISCONN_PHY_LINK,
150150
sizeof(cp), &cp);
151151
}
@@ -273,13 +273,14 @@ void hci_sco_setup(struct hci_conn *conn, __u8 status)
273273

274274
static void hci_conn_disconnect(struct hci_conn *conn)
275275
{
276-
__u8 reason = hci_proto_disconn_ind(conn);
276+
__u8 reason;
277277

278278
switch (conn->type) {
279279
case AMP_LINK:
280-
hci_amp_disconn(conn, reason);
280+
hci_amp_disconn(conn);
281281
break;
282282
default:
283+
reason = hci_proto_disconn_ind(conn);
283284
hci_disconnect(conn, reason);
284285
break;
285286
}

0 commit comments

Comments
 (0)