char: nwbutton: open-code interruptible_sleep_on
authorArnd Bergmann <arnd@arndb.de>
Thu, 2 Jan 2014 12:07:53 +0000 (13:07 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 Jan 2014 23:29:52 +0000 (15:29 -0800)
commiteb831743f2b43253b0aec40f66a95fdcf8f178cc
treec1b2787fa11d6bfe36a9964d3db7782fbe789b16
parent83ce07411dc2316aaaf95a0f193fa2fd76e2e739
char: nwbutton: open-code interruptible_sleep_on

The nwbutton driver uses interruptible_sleep_on to wait for buttons
getting pressed after we enter the read() function, which is inherently
racy and cannot be fixed by using wait_event without changing the
driver's user space interface.

Instead, this patch just uses an open-coded variant of the same
interruptible_sleep_on() call, so the driver behavior doesn't change
but we remove the sleep_on family from the kernel.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/nwbutton.c