[PATCH v2 09/12] android/handsfree: Pass device object to disconnect watch

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

 



---
 android/handsfree.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/android/handsfree.c b/android/handsfree.c
index fadbdce..4a55559 100644
--- a/android/handsfree.c
+++ b/android/handsfree.c
@@ -267,9 +267,11 @@ static void device_cleanup(struct hf_device *dev)
 
 static void disconnect_watch(void *user_data)
 {
+	struct hf_device *dev = user_data;
+
 	DBG("");
 
-	device_cleanup(&device);
+	device_cleanup(dev);
 }
 
 static void at_cmd_unknown(const char *command, void *user_data)
@@ -1375,7 +1377,7 @@ static void connect_cb(GIOChannel *chan, GError *err, gpointer user_data)
 
 	hfp_gw_set_close_on_unref(dev->gw, true);
 	hfp_gw_set_command_handler(dev->gw, at_cmd_unknown, dev, NULL);
-	hfp_gw_set_disconnect_handler(dev->gw, disconnect_watch, NULL, NULL);
+	hfp_gw_set_disconnect_handler(dev->gw, disconnect_watch, dev, NULL);
 
 	if (dev->hsp) {
 		register_post_slc_at(dev);
-- 
1.9.1

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