From a5f3e243dd4edd8a92f152e16a6c2b87e68728db Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Wed, 28 May 2025 10:24:31 -0400 Subject: [PATCH] audio/mcp: Fix passing callbacks as reference Callbacks are already a function pointer. --- profiles/audio/mcp.c | 39 +++++++++++---------------------------- 1 file changed, 11 insertions(+), 28 deletions(-) diff --git a/profiles/audio/mcp.c b/profiles/audio/mcp.c index 2808674cf..d3ccb97c5 100644 --- a/profiles/audio/mcp.c +++ b/profiles/audio/mcp.c @@ -190,17 +190,12 @@ static void cb_media_state(struct bt_mcp *mcp, uint8_t status) } static const struct bt_mcp_event_callback cbs = { - .player_name = &cb_player_name, - .track_changed = &cb_track_changed, - .track_title = &cb_track_title, - .track_duration = &cb_track_duration, - .track_position = &cb_track_position, - .playback_speed = NULL, - .seeking_speed = NULL, - .play_order = NULL, - .play_order_supported = NULL, - .media_state = &cb_media_state, - .content_control_id = NULL, + .player_name = cb_player_name, + .track_changed = cb_track_changed, + .track_title = cb_track_title, + .track_duration = cb_track_duration, + .track_position = cb_track_position, + .media_state = cb_media_state, }; static int ct_play(struct media_player *mp, void *user_data) @@ -239,23 +234,11 @@ static int ct_previous(struct media_player *mp, void *user_data) } static const struct media_player_callback ct_cbs = { - .set_setting = NULL, - .play = &ct_play, - .pause = &ct_pause, - .stop = &ct_stop, - .next = &ct_next, - .previous = &ct_previous, - .fast_forward = NULL, - .rewind = NULL, - .press = NULL, - .hold = NULL, - .release = NULL, - .list_items = NULL, - .change_folder = NULL, - .search = NULL, - .play_item = NULL, - .add_to_nowplaying = NULL, - .total_items = NULL, + .play = ct_play, + .pause = ct_pause, + .stop = ct_stop, + .next = ct_next, + .previous = ct_previous, }; static int mcp_probe(struct btd_service *service) -- 2.47.3