Bluetooth: Remove useless check in hci_connect()
authorAndre Guedes <andre.guedes@openbossa.org>
Tue, 31 May 2011 17:20:55 +0000 (14:20 -0300)
committerJaikumar Ganesh <jaikumar@google.com>
Mon, 11 Jul 2011 18:59:15 +0000 (11:59 -0700)
There is no need to check the connection's state since hci_conn_add()
has just created a new connection and its state has been set properly.

Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
Acked-by: Ville Tervo <ville.tervo@nokia.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
net/bluetooth/hci_conn.c

index 803628d6814e0f2908d0364e61c24a877f8663c0..0903effaf7ef01bc31016bcb20f7c95043c74887 100644 (file)
@@ -464,8 +464,8 @@ struct hci_conn *hci_connect(struct hci_dev *hdev, int type,
                le = hci_conn_add(hdev, LE_LINK, 0, dst);
                if (!le)
                        return ERR_PTR(-ENOMEM);
-               if (le->state == BT_OPEN)
-                       hci_le_connect(le);
+
+               hci_le_connect(le);
 
                hci_conn_hold(le);