]> code.delx.au - pulseaudio/commitdiff
bluetooth: Remove pa_bluetooth_device_get_transport()
authorMikel Astiz <mikel.astiz@bmw-carit.de>
Thu, 6 Dec 2012 09:35:20 +0000 (10:35 +0100)
committerTanu Kaskinen <tanuk@iki.fi>
Wed, 19 Dec 2012 10:31:48 +0000 (12:31 +0200)
With the use of an array to represent a device's transpors, the function
becomes trivial and thus can be removed.

src/modules/bluetooth/bluetooth-util.c
src/modules/bluetooth/bluetooth-util.h
src/modules/bluetooth/module-bluetooth-device.c

index 313df2ba4b32bb5fd8733cf674d3b71407b96ffd..91ad269a6fa21efc9209ea41811b88dd093ce2cd 100644 (file)
@@ -974,15 +974,6 @@ pa_bluetooth_device* pa_bluetooth_discovery_get_by_path(pa_bluetooth_discovery *
     return NULL;
 }
 
-pa_bluetooth_transport* pa_bluetooth_device_get_transport(pa_bluetooth_device *d, enum profile profile) {
-    pa_assert(d);
-
-    if (profile == PROFILE_OFF)
-        return NULL;
-
-    return d->transports[profile];
-}
-
 bool pa_bluetooth_device_any_audio_connected(const pa_bluetooth_device *d) {
     pa_assert(d);
 
index f6ffece10e7fbedad20bb5e57bfa8521a2336bef..59d0d2e3a29db4f19fafdebaf99605b963903b18 100644 (file)
@@ -145,7 +145,6 @@ void pa_bluetooth_discovery_sync(pa_bluetooth_discovery *d);
 pa_bluetooth_device* pa_bluetooth_discovery_get_by_path(pa_bluetooth_discovery *d, const char* path);
 pa_bluetooth_device* pa_bluetooth_discovery_get_by_address(pa_bluetooth_discovery *d, const char* address);
 
-pa_bluetooth_transport* pa_bluetooth_device_get_transport(pa_bluetooth_device *d, enum profile profile);
 bool pa_bluetooth_device_any_audio_connected(const pa_bluetooth_device *d);
 
 int pa_bluetooth_transport_acquire(pa_bluetooth_transport *t, const char *accesstype, size_t *imtu, size_t *omtu);
index 29c35e14f4a28eb9bcf8b59905f28e4446189aa0..4743db88496f3a9d9a9d63f43024f796482aa101 100644 (file)
@@ -1984,9 +1984,10 @@ static int setup_transport(struct userdata *u) {
 
     pa_assert(u);
     pa_assert(!u->transport);
+    pa_assert(u->profile != PROFILE_OFF);
 
     /* check if profile has a transport */
-    t = pa_bluetooth_device_get_transport(u->device, u->profile);
+    t = u->device->transports[u->profile];
     if (t == NULL) {
         pa_log_warn("Profile has no transport");
         return -1;