All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcin Kraglak <marcin.kraglak@tieto.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH 2/4] audio/avrcp: Pass error to session_destroy()
Date: Wed, 11 Mar 2015 19:11:01 +0100	[thread overview]
Message-ID: <1426097463-5288-3-git-send-email-marcin.kraglak@tieto.com> (raw)
In-Reply-To: <1426097463-5288-1-git-send-email-marcin.kraglak@tieto.com>

It will allow us to invoke btd_service_connecting_complete() or
btd_service_disconnecting_complete() with correct error code.
---
 profiles/audio/avrcp.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/profiles/audio/avrcp.c b/profiles/audio/avrcp.c
index dc57770..414ee25 100644
--- a/profiles/audio/avrcp.c
+++ b/profiles/audio/avrcp.c
@@ -3507,7 +3507,7 @@ static void target_destroy(struct avrcp *session)
 	g_free(target);
 }
 
-static void session_destroy(struct avrcp *session)
+static void session_destroy(struct avrcp *session, int err)
 {
 	struct avrcp_server *server = session->server;
 	struct btd_service *service;
@@ -3519,7 +3519,7 @@ static void session_destroy(struct avrcp *session)
 	service = btd_device_get_service(session->dev, AVRCP_TARGET_UUID);
 	if (service != NULL) {
 		if (session->control_id == 0)
-			btd_service_connecting_complete(service, -EIO);
+			btd_service_connecting_complete(service, err);
 		else
 			btd_service_disconnecting_complete(service, 0);
 	}
@@ -3527,7 +3527,7 @@ static void session_destroy(struct avrcp *session)
 	service = btd_device_get_service(session->dev, AVRCP_REMOTE_UUID);
 	if (service != NULL) {
 		if (session->control_id == 0)
-			btd_service_connecting_complete(service, -EIO);
+			btd_service_connecting_complete(service, err);
 		else
 			btd_service_disconnecting_complete(service, 0);
 	}
@@ -3586,7 +3586,7 @@ static void state_changed(struct btd_device *device, avctp_state_t old_state,
 		if (session == NULL)
 			break;
 
-		session_destroy(session);
+		session_destroy(session, err);
 
 		break;
 	case AVCTP_STATE_CONNECTING:
-- 
2.1.0


  parent reply	other threads:[~2015-03-11 18:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-11 18:10 [PATCH 0/4] Fix collision in AVCTP connection Marcin Kraglak
2015-03-11 18:11 ` [PATCH 1/4] audio/avctp: Pass error argument to avctp_state_changed callback Marcin Kraglak
2015-03-11 18:11 ` Marcin Kraglak [this message]
2015-03-11 18:11 ` [PATCH 3/4] audio/avctp: Cancel outgoing connection in case of conflict Marcin Kraglak
2015-03-11 18:11 ` [PATCH 4/4] plugins/policy: Try reconnect Control/Target services Marcin Kraglak
2015-03-13  8:42   ` Luiz Augusto von Dentz
2015-03-13  9:47     ` Marcin Kraglak
2015-03-13 12:09 ` [PATCH 0/4] Fix collision in AVCTP connection Luiz Augusto von Dentz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1426097463-5288-3-git-send-email-marcin.kraglak@tieto.com \
    --to=marcin.kraglak@tieto.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.