From: Marcel Holtmann <marcel@holtmann.org>
To: Brian Rogers <brian@xyzw.org>
Cc: linux-bluetooth@vger.kernel.org, Jiri Kosina <jkosina@suse.cz>
Subject: Re: [PATCH] Disconnect hidraw device when an input device is disconnected
Date: Mon, 20 Jul 2009 10:13:41 +0200 [thread overview]
Message-ID: <1248077621.4549.99.camel@violet> (raw)
In-Reply-To: <4A64254F.5080504@xyzw.org>
Hi Brian,
> 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);
> }
patch looks good. However I don't understand why the HID core can't do
that for us. This seems wrong for both cases.
Jiri, why does the HID core register input device and HIDRAW device for
us, but not disconnect it?
Regards
Marcel
next prev parent reply other threads:[~2009-07-20 8:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-20 8:05 [PATCH] Disconnect hidraw device when an input device is disconnected Brian Rogers
2009-07-20 8:13 ` Marcel Holtmann [this message]
2009-07-21 12:42 ` Jiri Kosina
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=1248077621.4549.99.camel@violet \
--to=marcel@holtmann.org \
--cc=brian@xyzw.org \
--cc=jkosina@suse.cz \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox