[PATCH 5/7] Move debug messages to their correspondent getters

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

 



---
 audio/avrcp.c |   19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/audio/avrcp.c b/audio/avrcp.c
index 058fa83..ea175e3 100644
--- a/audio/avrcp.c
+++ b/audio/avrcp.c
@@ -474,9 +474,15 @@ static int player_set_attribute(struct avrcp_player *player,
 
 static int player_get_attribute(struct avrcp_player *player, uint8_t attr)
 {
-	DBG("Get attribute: %u", attr);
+	int value;
 
-	return player->cb->get_setting(attr, player->user_data);
+	DBG("attr %u", attr);
+
+	value = player->cb->get_setting(attr, player->user_data);
+	if (value < 0)
+		DBG("attr %u not supported by player", attr);
+
+	return value;
 }
 
 static uint8_t avrcp_handle_get_capabilities(struct avrcp_player *player,
@@ -535,10 +541,8 @@ static uint8_t avrcp_handle_list_player_attributes(struct avrcp_player *player,
 		goto done;
 
 	for (i = 1; i <= AVRCP_ATTRIBUTE_SCAN; i++) {
-		if (player_get_attribute(player, i) < 0) {
-			DBG("Ignoring setting %u: not supported by player", i);
+		if (player_get_attribute(player, i) < 0)
 			continue;
-		}
 
 		len++;
 		pdu->params[len] = i;
@@ -677,11 +681,8 @@ static uint8_t avrcp_handle_get_current_player_value(struct avrcp_player *player
 		}
 
 		val = player_get_attribute(player, settings[i]);
-		if (val < 0) {
-			DBG("Ignoring %u: not supported by player",
-								settings[i]);
+		if (val < 0)
 			continue;
-		}
 
 		pdu->params[++len] = settings[i];
 		pdu->params[++len] = val;
-- 
1.7.7

--
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