Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit beb19e4c authored by Johan Hedberg's avatar Johan Hedberg Committed by Marcel Holtmann
Browse files

Bluetooth: Use EOPNOTSUPP instead of ENOTSUPP



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: default avatarJohan Hedberg <johan.hedberg@intel.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent 2f407f0a
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -834,7 +834,7 @@ struct hci_conn *hci_connect_acl(struct hci_dev *hdev, bdaddr_t *dst,
	struct hci_conn *acl;
	struct hci_conn *acl;


	if (!test_bit(HCI_BREDR_ENABLED, &hdev->dev_flags))
	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);
	acl = hci_conn_hash_lookup_ba(hdev, ACL_LINK, dst);
	if (!acl) {
	if (!acl) {
+1 −1
Original line number Original line Diff line number Diff line
@@ -7094,7 +7094,7 @@ int l2cap_chan_connect(struct l2cap_chan *chan, __le16 psm, u16 cid,
			break;
			break;
		/* fall through */
		/* fall through */
	default:
	default:
		err = -ENOTSUPP;
		err = -EOPNOTSUPP;
		goto done;
		goto done;
	}
	}


+1 −1
Original line number Original line Diff line number Diff line
@@ -279,7 +279,7 @@ static int l2cap_sock_listen(struct socket *sock, int backlog)
			break;
			break;
		/* fall through */
		/* fall through */
	default:
	default:
		err = -ENOTSUPP;
		err = -EOPNOTSUPP;
		goto done;
		goto done;
	}
	}


+2 −2
Original line number Original line Diff line number Diff line
@@ -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)) {
	if (!test_bit(HCI_LE_ENABLED, &hcon->hdev->dev_flags)) {
		err = -ENOTSUPP;
		err = -EOPNOTSUPP;
		reason = SMP_PAIRING_NOTSUPP;
		reason = SMP_PAIRING_NOTSUPP;
		goto done;
		goto done;
	}
	}
@@ -1207,7 +1207,7 @@ int smp_sig_channel(struct l2cap_conn *conn, struct sk_buff *skb)
	    !conn->smp_chan) {
	    !conn->smp_chan) {
		BT_ERR("Unexpected SMP command 0x%02x. Disconnecting.", code);
		BT_ERR("Unexpected SMP command 0x%02x. Disconnecting.", code);
		kfree_skb(skb);
		kfree_skb(skb);
		return -ENOTSUPP;
		return -EOPNOTSUPP;
	}
	}


	switch (code) {
	switch (code) {