From: Matthew Garrett <mjg59-1xO5oi07KQx4cg9Nei1l7Q@public.gmane.org>
To: Henrik Rydberg <rydberg-Hk7bIW8heu4wFerOooGFRg@public.gmane.org>
Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
oneukum-l3A5Bk7waGM@public.gmane.org
Subject: Re: [PATCH] usb: Keep track of actual LED state
Date: Mon, 10 Oct 2011 18:14:40 +0100 [thread overview]
Message-ID: <20111010171440.GA22288@srcf.ucam.org> (raw)
In-Reply-To: <20111010171314.GA2089-cSxB8VliqGEUVQd64OLqbEB+6BGkLq7r@public.gmane.org>
On Mon, Oct 10, 2011 at 07:13:14PM +0200, Henrik Rydberg wrote:
> > - usbhid->ledcount--;
> > + usbhid->ledstate &= ~(1 << code);
>
> Could simply check for ledcount > 0 here instead, but it is even uglier.
That'd still fail if we had one led turned on and two turned off -
depending on the order we'd potentially think that suspend was safe.
> Why not test the actual input_dev state here instead? Adding a set/get
> led state function to input core could resolve this cleanly.
That might well be a better approach.
--
Matthew Garrett | mjg59-1xO5oi07KQx4cg9Nei1l7Q@public.gmane.org
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2011-10-10 17:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-10 15:55 [PATCH] usb: Keep track of actual LED state Matthew Garrett
2011-10-10 17:13 ` Henrik Rydberg
[not found] ` <20111010171314.GA2089-cSxB8VliqGEUVQd64OLqbEB+6BGkLq7r@public.gmane.org>
2011-10-10 17:14 ` Matthew Garrett [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=20111010171440.GA22288@srcf.ucam.org \
--to=mjg59-1xo5oi07kqx4cg9nei1l7q@public.gmane.org \
--cc=linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=oneukum-l3A5Bk7waGM@public.gmane.org \
--cc=rydberg-Hk7bIW8heu4wFerOooGFRg@public.gmane.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;
as well as URLs for NNTP newsgroup(s).