[PATCH 2/6] avdtp: Remove user data from avdtp_session_state_cb

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



All users pass NULL as user data so there is no need to keep that.
---
 profiles/audio/avdtp.c  | 6 ++----
 profiles/audio/avdtp.h  | 5 ++---
 profiles/audio/device.c | 6 ++----
 profiles/audio/sink.c   | 6 ++----
 profiles/audio/source.c | 5 ++---
 5 files changed, 10 insertions(+), 18 deletions(-)

diff --git a/profiles/audio/avdtp.c b/profiles/audio/avdtp.c
index 36273ad..23934a6 100644
--- a/profiles/audio/avdtp.c
+++ b/profiles/audio/avdtp.c
@@ -357,7 +357,6 @@ struct stream_callback {
 struct avdtp_state_callback {
 	avdtp_session_state_cb cb;
 	struct audio_device *dev;
-	void *user_data;
 	unsigned int id;
 };
 
@@ -732,7 +731,7 @@ static void avdtp_set_state(struct avdtp *session,
 		if (dev != cb->dev)
 			continue;
 
-		cb->cb(dev, session, old_state, new_state, cb->user_data);
+		cb->cb(dev, session, old_state, new_state);
 	}
 }
 
@@ -3924,7 +3923,7 @@ void avdtp_set_device_disconnect(struct avdtp *session, gboolean dev_dc)
 }
 
 unsigned int avdtp_add_state_cb(avdtp_session_state_cb cb,
-				struct audio_device *dev, void *user_data)
+						struct audio_device *dev)
 {
 	struct avdtp_state_callback *state_cb;
 	static unsigned int id = 0;
@@ -3932,7 +3931,6 @@ unsigned int avdtp_add_state_cb(avdtp_session_state_cb cb,
 	state_cb = g_new(struct avdtp_state_callback, 1);
 	state_cb->cb = cb;
 	state_cb->dev = dev;
-	state_cb->user_data = user_data;
 	state_cb->id = ++id;
 
 	avdtp_callbacks = g_slist_append(avdtp_callbacks, state_cb);
diff --git a/profiles/audio/avdtp.h b/profiles/audio/avdtp.h
index 48b6748..270354a 100644
--- a/profiles/audio/avdtp.h
+++ b/profiles/audio/avdtp.h
@@ -119,8 +119,7 @@ struct avdtp_media_codec_capability {
 typedef void (*avdtp_session_state_cb) (struct audio_device *dev,
 					struct avdtp *session,
 					avdtp_session_state_t old_state,
-					avdtp_session_state_t new_state,
-					void *user_data);
+					avdtp_session_state_t new_state);
 
 typedef void (*avdtp_stream_state_cb) (struct avdtp_stream *stream,
 					avdtp_state_t old_state,
@@ -261,7 +260,7 @@ struct avdtp_remote_sep *avdtp_stream_get_remote_sep(
 						struct avdtp_stream *stream);
 
 unsigned int avdtp_add_state_cb(avdtp_session_state_cb cb,
-				struct audio_device *dev, void *user_data);
+						struct audio_device *dev);
 
 gboolean avdtp_remove_state_cb(unsigned int id);
 
diff --git a/profiles/audio/device.c b/profiles/audio/device.c
index 0c77468..663a341 100644
--- a/profiles/audio/device.c
+++ b/profiles/audio/device.c
@@ -226,8 +226,7 @@ static void device_set_state(struct audio_device *dev, audio_state_t new_state)
 
 static void device_avdtp_cb(struct audio_device *dev, struct avdtp *session,
 				avdtp_session_state_t old_state,
-				avdtp_session_state_t new_state,
-				void *user_data)
+				avdtp_session_state_t new_state)
 {
 	if (!dev->control)
 		return;
@@ -315,8 +314,7 @@ struct audio_device *audio_device_register(struct btd_device *device)
 	if (sink_callback_id == 0)
 		sink_callback_id = sink_add_state_cb(device_sink_cb, NULL);
 
-	dev->priv->avdtp_callback_id = avdtp_add_state_cb(device_avdtp_cb, dev,
-									NULL);
+	dev->priv->avdtp_callback_id = avdtp_add_state_cb(device_avdtp_cb, dev);
 
 	if (avctp_callback_id == 0)
 		avctp_callback_id = avctp_add_state_cb(device_avctp_cb, NULL);
diff --git a/profiles/audio/sink.c b/profiles/audio/sink.c
index 9dbff9d..2c0ec4b 100644
--- a/profiles/audio/sink.c
+++ b/profiles/audio/sink.c
@@ -110,8 +110,7 @@ static void sink_set_state(struct audio_device *dev, sink_state_t new_state)
 static void avdtp_state_callback(struct audio_device *dev,
 					struct avdtp *session,
 					avdtp_session_state_t old_state,
-					avdtp_session_state_t new_state,
-					void *user_data)
+					avdtp_session_state_t new_state)
 {
 	struct sink *sink = dev->sink;
 
@@ -378,8 +377,7 @@ struct sink *sink_init(struct audio_device *dev)
 
 	sink->dev = dev;
 
-	sink->avdtp_callback_id = avdtp_add_state_cb(avdtp_state_callback, dev,
-									NULL);
+	sink->avdtp_callback_id = avdtp_add_state_cb(avdtp_state_callback, dev);
 
 	return sink;
 }
diff --git a/profiles/audio/source.c b/profiles/audio/source.c
index 2cbd08d..4ebe598 100644
--- a/profiles/audio/source.c
+++ b/profiles/audio/source.c
@@ -111,8 +111,7 @@ static void source_set_state(struct audio_device *dev, source_state_t new_state)
 static void avdtp_state_callback(struct audio_device *dev,
 					struct avdtp *session,
 					avdtp_session_state_t old_state,
-					avdtp_session_state_t new_state,
-					void *user_data)
+					avdtp_session_state_t new_state)
 {
 	struct source *source = dev->source;
 
@@ -384,7 +383,7 @@ struct source *source_init(struct audio_device *dev)
 	source->dev = dev;
 
 	source->avdtp_callback_id = avdtp_add_state_cb(avdtp_state_callback,
-								dev, NULL);
+									dev);
 
 	return source;
 }
-- 
1.8.1.5

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux