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

Commit 74e75740 authored by Gustavo Padovan's avatar Gustavo Padovan Committed by Marcel Holtmann
Browse files

Bluetooth: use l2cap_chan_ready() instead of duplicate code



In this case the replacement by l2cap_chan_ready() doesn't change the code
flow, the same operations will executed plus two others that have no
effect: the use of the parent socket, that a non-oriented channel doesn't
have and the reset of conf_state, which is also fine since the connection
is ready at this point.

Signed-off-by: default avatarGustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent dc25306b
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -1450,12 +1450,7 @@ static void l2cap_conn_ready(struct l2cap_conn *conn)
				l2cap_chan_ready(chan);

		} else if (chan->chan_type != L2CAP_CHAN_CONN_ORIENTED) {
			struct sock *sk = chan->sk;
			__clear_chan_timer(chan);
			lock_sock(sk);
			__l2cap_state_change(chan, BT_CONNECTED);
			sk->sk_state_change(sk);
			release_sock(sk);
			l2cap_chan_ready(chan);

		} else if (chan->state == BT_CONNECT) {
			l2cap_do_start(chan);