]> code.delx.au - pulseaudio/commitdiff
bluetooth: Remove return value of bt_transport_config()
authorMikel Astiz <mikel.astiz@bmw-carit.de>
Fri, 31 Aug 2012 10:50:53 +0000 (12:50 +0200)
committerArun Raghavan <arun.raghavan@collabora.co.uk>
Wed, 26 Sep 2012 11:27:13 +0000 (19:27 +0800)
The function bt_transport_config() never fails so the code can be
simplified by just removing the return value.

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

index a023c19a2bfbd8c2fed4cb2c8dcbc376ad6fbea9..9762fe9cf36c5491f444c85f655fc0f2a2460661 100644 (file)
@@ -1621,7 +1621,7 @@ static int add_source(struct userdata *u) {
     return 0;
 }
 
-static int bt_transport_config_a2dp(struct userdata *u) {
+static void bt_transport_config_a2dp(struct userdata *u) {
     const pa_bluetooth_transport *t;
     struct a2dp_info *a2dp = &u->a2dp;
     a2dp_sbc_t *config;
@@ -1738,21 +1738,17 @@ static int bt_transport_config_a2dp(struct userdata *u) {
 
     pa_log_info("SBC parameters:\n\tallocation=%u\n\tsubbands=%u\n\tblocks=%u\n\tbitpool=%u\n",
                 a2dp->sbc.allocation, a2dp->sbc.subbands, a2dp->sbc.blocks, a2dp->sbc.bitpool);
-
-    return 0;
 }
 
-static int bt_transport_config(struct userdata *u) {
+static void bt_transport_config(struct userdata *u) {
     if (u->profile == PROFILE_HSP || u->profile == PROFILE_HFGW) {
         u->read_block_size = u->read_link_mtu;
         u->write_block_size = u->write_link_mtu;
         u->sample_spec.format = PA_SAMPLE_S16LE;
         u->sample_spec.channels = 1;
         u->sample_spec.rate = 8000;
-        return 0;
-    }
-
-    return bt_transport_config_a2dp(u);
+    } else
+        bt_transport_config_a2dp(u);
 }
 
 /* Run from main thread */
@@ -1786,7 +1782,9 @@ static int setup_bt(struct userdata *u) {
     if (bt_transport_acquire(u, FALSE) < 0)
         return -1;
 
-    return bt_transport_config(u);
+    bt_transport_config(u);
+
+    return 0;
 }
 
 /* Run from main thread */