Re: [PATCH] usb: Keep track of actual LED state

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

 



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@xxxxxxxxxxxxx
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux