aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/6lowpan.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2015-10-06 13:03:24 +0300
committerMarcel Holtmann <marcel@holtmann.org>2015-10-08 10:43:52 +0200
commit26d46dffbe2cd0a023aa6192708f80cd796af107 (patch)
tree59100786c470913a755294aabc6f42e02c72778f /net/bluetooth/6lowpan.c
parentBluetooth: 6lowpan: Rename confusing 'pchan' variables (diff)
downloadlinux-dev-26d46dffbe2cd0a023aa6192708f80cd796af107.tar.xz
linux-dev-26d46dffbe2cd0a023aa6192708f80cd796af107.zip
Bluetooth: 6lowpan: Remove unnecessary chan_get() function
The chan_get() function just adds unnecessary indirection to calling the chan_create() call. The only added value it gives is the chan->ops assignment, but that can equally well be done in the calling code. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Acked-by: Jukka Rissanen <jukka.rissanen@linux.intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/6lowpan.c')
-rw-r--r--net/bluetooth/6lowpan.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/net/bluetooth/6lowpan.c b/net/bluetooth/6lowpan.c
index e20b97297a15..9363f05275f4 100644
--- a/net/bluetooth/6lowpan.c
+++ b/net/bluetooth/6lowpan.c
@@ -1051,28 +1051,17 @@ static inline __u8 bdaddr_type(__u8 type)
return BDADDR_LE_RANDOM;
}
-static struct l2cap_chan *chan_get(void)
-{
- struct l2cap_chan *chan;
-
- chan = chan_create();
- if (!chan)
- return NULL;
-
- chan->ops = &bt_6lowpan_chan_ops;
-
- return chan;
-}
-
static int bt_6lowpan_connect(bdaddr_t *addr, u8 dst_type)
{
struct l2cap_chan *chan;
int err;
- chan = chan_get();
+ chan = chan_create();
if (!chan)
return -EINVAL;
+ chan->ops = &bt_6lowpan_chan_ops;
+
err = l2cap_chan_connect(chan, cpu_to_le16(L2CAP_PSM_IPSP), 0,
addr, dst_type);
@@ -1109,10 +1098,11 @@ static struct l2cap_chan *bt_6lowpan_listen(void)
if (!enable_6lowpan)
return NULL;
- chan = chan_get();
+ chan = chan_create();
if (!chan)
return NULL;
+ chan->ops = &bt_6lowpan_chan_ops;
chan->state = BT_LISTEN;
chan->src_type = BDADDR_LE_PUBLIC;