aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_conn.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2014-07-16 11:42:28 +0300
committerMarcel Holtmann <marcel@holtmann.org>2014-07-16 11:04:23 +0200
commite804d25d4a07c0ff9e5e1c58ea5ee67232aa9af8 (patch)
treeb52e7927dace2aa691585d9dd12534d36ade1b87 /net/bluetooth/hci_conn.c
parentBluetooth: Convert HCI_CONN_MASTER flag to a conn->role variable (diff)
downloadlinux-dev-e804d25d4a07c0ff9e5e1c58ea5ee67232aa9af8.tar.xz
linux-dev-e804d25d4a07c0ff9e5e1c58ea5ee67232aa9af8.zip
Bluetooth: Use explicit role instead of a bool in function parameters
To make the code more understandable it makes sense to use the new HCI defines for connection role instead of a "bool master" parameter. This makes it immediately clear when looking at the function calls what the last parameter is describing. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/hci_conn.c')
-rw-r--r--net/bluetooth/hci_conn.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index 6c1c5048984c..6edd55340157 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -697,7 +697,7 @@ static void hci_req_directed_advertising(struct hci_request *req,
struct hci_conn *hci_connect_le(struct hci_dev *hdev, bdaddr_t *dst,
u8 dst_type, u8 sec_level, u16 conn_timeout,
- bool master)
+ u8 role)
{
struct hci_conn_params *params;
struct hci_conn *conn;
@@ -769,8 +769,10 @@ struct hci_conn *hci_connect_le(struct hci_dev *hdev, bdaddr_t *dst,
&enable);
}
+ conn->role = role;
+
/* If requested to connect as slave use directed advertising */
- if (!master) {
+ if (conn->role == HCI_ROLE_SLAVE) {
/* If we're active scanning most controllers are unable
* to initiate advertising. Simply reject the attempt.
*/
@@ -786,7 +788,6 @@ struct hci_conn *hci_connect_le(struct hci_dev *hdev, bdaddr_t *dst,
}
conn->out = true;
- conn->role = HCI_ROLE_MASTER;
params = hci_conn_params_lookup(hdev, &conn->dst, conn->dst_type);
if (params) {