From 302ec9fa37fb8e9af5cd20f8923350edf88694a7 Mon Sep 17 00:00:00 2001 From: Emil Gydesen Date: Mon, 18 Jul 2022 17:09:59 +0200 Subject: [PATCH] Bluetooth: Audio: Remove const for bt_audio_stream_reconfig codec The codec is assigned to the stream. However since the metadata, which is stored in the codec, may be modified by other means, the stored pointer cannot be const, and thus the codec argument to bt_audio_stream_reconfig cannot be const either. Signed-off-by: Emil Gydesen --- include/zephyr/bluetooth/audio/audio.h | 4 ++-- subsys/bluetooth/audio/stream.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/zephyr/bluetooth/audio/audio.h b/include/zephyr/bluetooth/audio/audio.h index d7eccfbf83e..2ceef7f9a50 100644 --- a/include/zephyr/bluetooth/audio/audio.h +++ b/include/zephyr/bluetooth/audio/audio.h @@ -1294,7 +1294,7 @@ struct bt_audio_stream { /** Endpoint reference */ struct bt_audio_ep *ep; /** Codec Configuration */ - const struct bt_codec *codec; + struct bt_codec *codec; /** QoS Configuration */ struct bt_codec_qos *qos; /** Audio stream operations */ @@ -1804,7 +1804,7 @@ int bt_audio_stream_config(struct bt_conn *conn, * @return 0 in case of success or negative value in case of error. */ int bt_audio_stream_reconfig(struct bt_audio_stream *stream, - const struct bt_codec *codec); + struct bt_codec *codec); /** @brief Configure Audio Stream QoS * diff --git a/subsys/bluetooth/audio/stream.c b/subsys/bluetooth/audio/stream.c index 8424eb76f4b..d591d049442 100644 --- a/subsys/bluetooth/audio/stream.c +++ b/subsys/bluetooth/audio/stream.c @@ -1103,7 +1103,7 @@ int bt_audio_unicast_group_delete(struct bt_audio_unicast_group *unicast_group) #endif /* CONFIG_BT_AUDIO_UNICAST_CLIENT */ int bt_audio_stream_reconfig(struct bt_audio_stream *stream, - const struct bt_codec *codec) + struct bt_codec *codec) { uint8_t state; uint8_t role;