Merge tag 'mmc-v3.17-1' of git://git.linaro.org/people/ulf.hansson/mmc
[firefly-linux-kernel-4.4.55.git] / net / bluetooth / amp.c
index bb39509b3f065e2a0d18e1a53cfcfabc8bfe779e..016cdb66df6cfa5bfd4bb7fcd808a616e9fcde42 100644 (file)
@@ -113,8 +113,9 @@ struct hci_conn *phylink_add(struct hci_dev *hdev, struct amp_mgr *mgr,
 {
        bdaddr_t *dst = &mgr->l2cap_conn->hcon->dst;
        struct hci_conn *hcon;
+       u8 role = out ? HCI_ROLE_MASTER : HCI_ROLE_SLAVE;
 
-       hcon = hci_conn_add(hdev, AMP_LINK, dst);
+       hcon = hci_conn_add(hdev, AMP_LINK, dst, role);
        if (!hcon)
                return NULL;
 
@@ -125,7 +126,6 @@ struct hci_conn *phylink_add(struct hci_dev *hdev, struct amp_mgr *mgr,
        hcon->handle = __next_handle(mgr);
        hcon->remote_id = remote_id;
        hcon->amp_mgr = amp_mgr_get(mgr);
-       hcon->out = out;
 
        return hcon;
 }
@@ -133,8 +133,8 @@ struct hci_conn *phylink_add(struct hci_dev *hdev, struct amp_mgr *mgr,
 /* AMP crypto key generation interface */
 static int hmac_sha256(u8 *key, u8 ksize, char *plaintext, u8 psize, u8 *output)
 {
-       int ret = 0;
        struct crypto_shash *tfm;
+       int ret;
 
        if (!ksize)
                return -EINVAL;