Bluetooth: Use EOPNOTSUPP instead of ENOTSUPP
authorJohan Hedberg <johan.hedberg@intel.com>
Fri, 18 Jul 2014 08:15:26 +0000 (11:15 +0300)
committerMarcel Holtmann <marcel@holtmann.org>
Fri, 18 Jul 2014 09:11:38 +0000 (11:11 +0200)
The EOPNOTSUPP and ENOTSUPP errors are very similar in meaning, but
ENOTSUPP is a fairly new addition to POSIX. Not all libc versions know
about the value the kernel uses for ENOTSUPP so it's better to use
EOPNOTSUPP to ensure understandable error messages.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/bluetooth/hci_conn.c
net/bluetooth/l2cap_core.c
net/bluetooth/l2cap_sock.c
net/bluetooth/smp.c

index 0d76054efd268bc66fe557d099fb2c47707d61b9..1ac9f7f52acd54db5eccf75a12d7312ce49eadfb 100644 (file)
@@ -834,7 +834,7 @@ struct hci_conn *hci_connect_acl(struct hci_dev *hdev, bdaddr_t *dst,
        struct hci_conn *acl;
 
        if (!test_bit(HCI_BREDR_ENABLED, &hdev->dev_flags))
-               return ERR_PTR(-ENOTSUPP);
+               return ERR_PTR(-EOPNOTSUPP);
 
        acl = hci_conn_hash_lookup_ba(hdev, ACL_LINK, dst);
        if (!acl) {
index c8c259f21d807bf9c545bd22e1c4d85e6769f37f..f3fb61c9f96ff05954dad6281c08518710cba69f 100644 (file)
@@ -7094,7 +7094,7 @@ int l2cap_chan_connect(struct l2cap_chan *chan, __le16 psm, u16 cid,
                        break;
                /* fall through */
        default:
-               err = -ENOTSUPP;
+               err = -EOPNOTSUPP;
                goto done;
        }
 
index 3bb1cdf34f0760f7f836eb80585301710b5d6375..1884f72083c2f7de4595e91f2cdb61f02cef99bb 100644 (file)
@@ -279,7 +279,7 @@ static int l2cap_sock_listen(struct socket *sock, int backlog)
                        break;
                /* fall through */
        default:
-               err = -ENOTSUPP;
+               err = -EOPNOTSUPP;
                goto done;
        }
 
index 74a0308e39f38f227700c1638047883341a220fe..e49c83d8b95709d7ce602869dffde715df730b58 100644 (file)
@@ -1189,7 +1189,7 @@ int smp_sig_channel(struct l2cap_conn *conn, struct sk_buff *skb)
        }
 
        if (!test_bit(HCI_LE_ENABLED, &hcon->hdev->dev_flags)) {
-               err = -ENOTSUPP;
+               err = -EOPNOTSUPP;
                reason = SMP_PAIRING_NOTSUPP;
                goto done;
        }
@@ -1207,7 +1207,7 @@ int smp_sig_channel(struct l2cap_conn *conn, struct sk_buff *skb)
            !conn->smp_chan) {
                BT_ERR("Unexpected SMP command 0x%02x. Disconnecting.", code);
                kfree_skb(skb);
-               return -ENOTSUPP;
+               return -EOPNOTSUPP;
        }
 
        switch (code) {