aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/sco.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2014-07-13 13:54:49 -0400
committerJohan Hedberg <johan.hedberg@intel.com>2014-07-13 14:39:38 -0400
commite03ab5199df597d3f1737ef638a7f692daaaef9f (patch)
treebfc8859bb3e29deac1861266967f4f90f1d20249 /net/bluetooth/sco.c
parent015b01cbca20276a6b09ad25ce4002e811a53130 (diff)
Bluetooth: Remove unneeded forward declaration of sco_chan_del
The forward declaration of sco_chan_del is not needed and thus just remove it. Move sco_chan_del into the proper location. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net/bluetooth/sco.c')
-rw-r--r--net/bluetooth/sco.c56
1 files changed, 27 insertions, 29 deletions
diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c
index 75cffc14ab6e..4d67b0354d23 100644
--- a/net/bluetooth/sco.c
+++ b/net/bluetooth/sco.c
@@ -53,8 +53,6 @@ struct sco_conn {
53#define sco_conn_lock(c) spin_lock(&c->lock); 53#define sco_conn_lock(c) spin_lock(&c->lock);
54#define sco_conn_unlock(c) spin_unlock(&c->lock); 54#define sco_conn_unlock(c) spin_unlock(&c->lock);
55 55
56static void sco_chan_del(struct sock *sk, int err);
57
58static void sco_sock_close(struct sock *sk); 56static void sco_sock_close(struct sock *sk);
59static void sco_sock_kill(struct sock *sk); 57static void sco_sock_kill(struct sock *sk);
60 58
@@ -138,6 +136,33 @@ static struct sock *sco_chan_get(struct sco_conn *conn)
138 return sk; 136 return sk;
139} 137}
140 138
139/* Delete channel.
140 * Must be called on the locked socket. */
141static void sco_chan_del(struct sock *sk, int err)
142{
143 struct sco_conn *conn;
144
145 conn = sco_pi(sk)->conn;
146
147 BT_DBG("sk %p, conn %p, err %d", sk, conn, err);
148
149 if (conn) {
150 sco_conn_lock(conn);
151 conn->sk = NULL;
152 sco_pi(sk)->conn = NULL;
153 sco_conn_unlock(conn);
154
155 if (conn->hcon)
156 hci_conn_drop(conn->hcon);
157 }
158
159 sk->sk_state = BT_CLOSED;
160 sk->sk_err = err;
161 sk->sk_state_change(sk);
162
163 sock_set_flag(sk, SOCK_ZAPPED);
164}
165
141static int sco_conn_del(struct hci_conn *hcon, int err) 166static int sco_conn_del(struct hci_conn *hcon, int err)
142{ 167{
143 struct sco_conn *conn = hcon->sco_data; 168 struct sco_conn *conn = hcon->sco_data;
@@ -978,33 +1003,6 @@ static int sco_sock_release(struct socket *sock)
978 return err; 1003 return err;
979} 1004}
980 1005
981/* Delete channel.
982 * Must be called on the locked socket. */
983static void sco_chan_del(struct sock *sk, int err)
984{
985 struct sco_conn *conn;
986
987 conn = sco_pi(sk)->conn;
988
989 BT_DBG("sk %p, conn %p, err %d", sk, conn, err);
990
991 if (conn) {
992 sco_conn_lock(conn);
993 conn->sk = NULL;
994 sco_pi(sk)->conn = NULL;
995 sco_conn_unlock(conn);
996
997 if (conn->hcon)
998 hci_conn_drop(conn->hcon);
999 }
1000
1001 sk->sk_state = BT_CLOSED;
1002 sk->sk_err = err;
1003 sk->sk_state_change(sk);
1004
1005 sock_set_flag(sk, SOCK_ZAPPED);
1006}
1007
1008static void sco_conn_ready(struct sco_conn *conn) 1006static void sco_conn_ready(struct sco_conn *conn)
1009{ 1007{
1010 struct sock *parent; 1008 struct sock *parent;