From: Johan Hedberg <johan.hedberg@gmail.com>
To: Jeff Hansen <x@jeffhansen.com>
Cc: linux-bluetooth@vger.kernel.org, Marcel Holtmann <marcel@holtmann.org>
Subject: Re: [PATCH] [input] Set up uinput device again, if it was previously closed.
Date: Sun, 4 Mar 2012 21:11:00 -0800 [thread overview]
Message-ID: <20120305051100.GA3721@x220> (raw)
In-Reply-To: <1330919059-5493-1-git-send-email-x@jeffhansen.com>
Hi Jeff,
On Sun, Mar 04, 2012, Jeff Hansen wrote:
> If you connect a PS3 controller to bluetoothd as an input device, then
> take the batteries out of a PS3 controller, then put them back in and
> push a few buttons, it will eventually cause an error which causes the
> uinput socket to be closed. It will then re-connect to bluetoothd, but
> the uinput socket fd will be -1, so it needs to be set up again after
> the re-connect.
>
> Signed-off-by: Jeff Hansen <x@jeffhansen.com>
> ---
> input/fakehid.c | 5 ++++-
> 1 files changed, 4 insertions(+), 1 deletions(-)
Thanks, the patch has been pushed upstream but there were a few minor
fixes I had to do before that. Firstly, we don't use signed-off-by for
user space patches. Then, a few stylistic issues with the code:
> + if (old == NULL || old->uinput == -1) {
We usually use < 0 for testing for an invalid fd.
> + if (old == NULL) {
> fake_hid->devices = g_list_append(fake_hid->devices, fake);
> }
Single-line branches do not need { }
Johan
prev parent reply other threads:[~2012-03-05 5:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-05 3:44 [PATCH] [input] Set up uinput device again, if it was previously closed Jeff Hansen
2012-03-05 5:11 ` Johan Hedberg [this message]
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=20120305051100.GA3721@x220 \
--to=johan.hedberg@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=marcel@holtmann.org \
--cc=x@jeffhansen.com \
/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;
as well as URLs for NNTP newsgroup(s).