mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Aleksey Kuleshov <rndfax@yandex.ru>
To: barebox@lists.infradead.org
Cc: Aleksey Kuleshov <rndfax@yandex.ru>
Subject: [PATCH v3 5/5] usb_kbd: lock is useless since pollers are atomic
Date: Wed,  9 Mar 2016 13:17:52 +0300	[thread overview]
Message-ID: <1457518672-30074-5-git-send-email-rndfax@yandex.ru> (raw)
In-Reply-To: <1457518672-30074-1-git-send-email-rndfax@yandex.ru>

Signed-off-by: Aleksey Kuleshov <rndfax@yandex.ru>
---
 drivers/input/usb_kbd.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/drivers/input/usb_kbd.c b/drivers/input/usb_kbd.c
index bdaf305..2acc95d 100644
--- a/drivers/input/usb_kbd.c
+++ b/drivers/input/usb_kbd.c
@@ -50,7 +50,6 @@ struct usb_kbd_pdata {
 	uint8_t		old[USB_KBD_BOOT_REPORT_SIZE];
 	struct poller_async	poller;
 	struct usb_device	*usbdev;
-	int		lock;
 	unsigned long	intpipe;
 	int		intpktsize;
 	int		intinterval;
@@ -98,16 +97,11 @@ static void usb_kbd_poll(void *arg)
 	struct usb_device *usbdev = data->usbdev;
 	int ret, i;
 
-	if (data->lock)
-		return;
-
-	data->lock = 1;
-
 	ret = data->do_poll(data);
 	if (ret == -EAGAIN)
 		goto exit;
 	if (ret < 0) {
-		/* exit and lock forever */
+		/* exit with noreturn */
 		dev_err(&usbdev->dev,
 			"usb_submit_int_msg() failed. Keyboard disconnect?\n");
 		return;
@@ -144,7 +138,6 @@ static void usb_kbd_poll(void *arg)
 	memcpy(data->old, data->new, USB_KBD_BOOT_REPORT_SIZE);
 
 exit:
-	data->lock = 0;
 	poller_call_async(&data->poller, data->intinterval * MSECOND, usb_kbd_poll, data);
 }
 
-- 
2.6.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2016-03-09 10:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-09 10:17 [PATCH v3 1/5] usb_kbd: remove unused fields Aleksey Kuleshov
2016-03-09 10:17 ` [PATCH v3 2/5] usb_kbd: check for registering error Aleksey Kuleshov
2016-03-09 10:17 ` [PATCH v3 3/5] usb_kbd: style fixes Aleksey Kuleshov
2016-03-09 10:17 ` [PATCH v3 4/5] usb_kbd: use async polling instead of regular polling Aleksey Kuleshov
2016-03-09 10:17 ` Aleksey Kuleshov [this message]
2016-03-10  9:01 ` [PATCH v3 1/5] usb_kbd: remove unused fields Sascha Hauer

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=1457518672-30074-5-git-send-email-rndfax@yandex.ru \
    --to=rndfax@yandex.ru \
    --cc=barebox@lists.infradead.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