From 061fb633a57dba665f87382e81aa02248053a9ef Mon Sep 17 00:00:00 2001 From: Emil Gydesen Date: Tue, 23 Nov 2021 14:51:13 +0100 Subject: [PATCH] Bluetooth: CSIS: Remove conn from bt_csis_client_lock_changed_cb The connection pointer can be inferred based on the set pointer, by using e.g. CONTAINER_OF. Signed-off-by: Emil Gydesen --- include/bluetooth/audio/csis.h | 4 +--- subsys/bluetooth/audio/csis_client.c | 2 +- .../bluetooth/bsim_bt/bsim_test_audio/src/csis_client_test.c | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/include/bluetooth/audio/csis.h b/include/bluetooth/audio/csis.h index 0691d391b02..2406fd39e31 100644 --- a/include/bluetooth/audio/csis.h +++ b/include/bluetooth/audio/csis.h @@ -242,14 +242,12 @@ typedef void (*bt_csis_client_lock_set_cb)(int err); /** * @brief Callback when the lock value on a set of a connected device changes. * - * @param conn Connection of the CSIS server. * @param set The set that was changed. * @param locked Whether the lock is locked or release. * * @return int Return 0 on success, or an errno value on error. */ -typedef void (*bt_csis_client_lock_changed_cb)(struct bt_conn *conn, - struct bt_csis_client_set *set, +typedef void (*bt_csis_client_lock_changed_cb)(struct bt_csis_client_set *set, bool locked); /** diff --git a/subsys/bluetooth/audio/csis_client.c b/subsys/bluetooth/audio/csis_client.c index 77d1bba031d..2257f12fcf6 100644 --- a/subsys/bluetooth/audio/csis_client.c +++ b/subsys/bluetooth/audio/csis_client.c @@ -321,7 +321,7 @@ static uint8_t lock_notify_func(struct bt_conn *conn, client = &client_insts[bt_conn_index(conn)]; set = &client->set_member->sets[csis_inst->cli.idx]; - csis_client_cbs->lock_changed(conn, set, locked); + csis_client_cbs->lock_changed(set, locked); } } else { BT_DBG("Invalid length %u", length); diff --git a/tests/bluetooth/bsim_bt/bsim_test_audio/src/csis_client_test.c b/tests/bluetooth/bsim_bt/bsim_test_audio/src/csis_client_test.c index 732394740d3..541ed68d51f 100644 --- a/tests/bluetooth/bsim_bt/bsim_test_audio/src/csis_client_test.c +++ b/tests/bluetooth/bsim_bt/bsim_test_audio/src/csis_client_test.c @@ -75,8 +75,7 @@ static void csis_discover_cb(struct bt_csis_client_set_member *member, int err, discovered = true; } -static void csis_lock_changed_cb(struct bt_conn *conn, - struct bt_csis_client_set *set, +static void csis_lock_changed_cb(struct bt_csis_client_set *set, bool locked) { printk("Set %p %s\n", set, locked ? "locked" : "released");