public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Disconnect hidraw device when an input device is disconnected
@ 2009-07-20  8:05 Brian Rogers
  2009-07-20  8:13 ` Marcel Holtmann
  0 siblings, 1 reply; 3+ messages in thread
From: Brian Rogers @ 2009-07-20  8:05 UTC (permalink / raw)
  To: linux-bluetooth

[-- Attachment #1: Type: text/plain, Size: 1 bytes --]



[-- Attachment #2: 0002-Bluetooth-Disconnect-hidraw-device-when-an-input-dev.patch --]
[-- Type: text/x-patch, Size: 1230 bytes --]

>From 487bccfd500d161dadf7b92be1ca2f8cca2b7781 Mon Sep 17 00:00:00 2001
From: Brian Rogers <brian@xyzw.org>
Date: Sun, 19 Jul 2009 18:23:21 -0700
Subject: [PATCH 2/2] Bluetooth: Disconnect hidraw device when an input device is disconnected

hidraw didn't exist when Bluetooth code was adapted to use the HID subsystem.
Now that it does exist, hidp is responsible for disconnecting it. Without
doing this, old hidraw devices stick around forever.

Signed-off-by: Brian Rogers <brian@xyzw.org>
---
 net/bluetooth/hidp/core.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c
index a9f7afb..5def2db 100644
--- a/net/bluetooth/hidp/core.c
+++ b/net/bluetooth/hidp/core.c
@@ -40,6 +40,7 @@
 
 #include <linux/input.h>
 #include <linux/hid.h>
+#include <linux/hidraw.h>
 
 #include <net/bluetooth/bluetooth.h>
 #include <net/bluetooth/hci_core.h>
@@ -574,6 +575,8 @@ static int hidp_session(void *arg)
 	if (session->hid) {
 		if (session->hid->claimed & HID_CLAIMED_INPUT)
 			hidinput_disconnect(session->hid);
+		if (session->hid->claimed & HID_CONNECT_HIDRAW)
+			hidraw_disconnect(session->hid);
 		hid_destroy_device(session->hid);
 	}
 
-- 
1.6.3.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-07-21 12:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-20  8:05 [PATCH] Disconnect hidraw device when an input device is disconnected Brian Rogers
2009-07-20  8:13 ` Marcel Holtmann
2009-07-21 12:42   ` Jiri Kosina

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox