public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
From: Oliver Neukum <oneukum@suse.com>
To: linux-usb@vger.kernel.org
Cc: Oliver Neukum <oneukum@suse.com>
Subject: [RFC 2/2] hid: usbhid: rename reset_work
Date: Wed, 25 Mar 2026 11:31:49 +0100	[thread overview]
Message-ID: <20260325103210.198820-2-oneukum@suse.com> (raw)
In-Reply-To: <20260325103210.198820-1-oneukum@suse.com>

Now that reset is used directly, there is no point
in calling the generic error handling reset_work.

Signed-off-by: Oliver Neukum <oneukum@suse.com>
---
 drivers/hid/usbhid/hid-core.c | 14 +++++++-------
 drivers/hid/usbhid/usbhid.h   |  2 +-
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
index a70721b3add6..6cfdfc2be68b 100644
--- a/drivers/hid/usbhid/hid-core.c
+++ b/drivers/hid/usbhid/hid-core.c
@@ -114,11 +114,11 @@ static void hid_retry_timeout(struct timer_list *t)
 		hid_io_error(hid);
 }
 
-/* Workqueue routine to reset the device or clear a halt */
-static void hid_reset(struct work_struct *work)
+/* Workqueue routine to clear a halt */
+static void hid_err_work(struct work_struct *work)
 {
 	struct usbhid_device *usbhid =
-		container_of(work, struct usbhid_device, reset_work);
+		container_of(work, struct usbhid_device, error_work);
 	struct hid_device *hid = usbhid->hid;
 	int rc;
 
@@ -297,7 +297,7 @@ static void hid_irq_in(struct urb *urb)
 		usbhid_mark_busy(usbhid);
 		clear_bit(HID_IN_RUNNING, &usbhid->iofl);
 		set_bit(HID_CLEAR_HALT, &usbhid->iofl);
-		schedule_work(&usbhid->reset_work);
+		schedule_work(&usbhid->error_work);
 		return;
 	case -ECONNRESET:	/* unlink */
 	case -ENOENT:
@@ -1438,7 +1438,7 @@ static int usbhid_probe(struct usb_interface *intf, const struct usb_device_id *
 	usbhid->ifnum = interface->desc.bInterfaceNumber;
 
 	init_waitqueue_head(&usbhid->wait);
-	INIT_WORK(&usbhid->reset_work, hid_reset);
+	INIT_WORK(&usbhid->error_work, hid_err_work);
 	timer_setup(&usbhid->io_retry, hid_retry_timeout, 0);
 	spin_lock_init(&usbhid->lock);
 	mutex_init(&usbhid->mutex);
@@ -1477,7 +1477,7 @@ static void usbhid_disconnect(struct usb_interface *intf)
 static void hid_cancel_delayed_stuff(struct usbhid_device *usbhid)
 {
 	timer_delete_sync(&usbhid->io_retry);
-	cancel_work_sync(&usbhid->reset_work);
+	cancel_work_sync(&usbhid->error_work);
 }
 
 static void hid_cease_io(struct usbhid_device *usbhid)
@@ -1498,7 +1498,7 @@ static void hid_restart_io(struct hid_device *hid)
 	usbhid_mark_busy(usbhid);
 
 	if (clear_halt)
-		schedule_work(&usbhid->reset_work);
+		schedule_work(&usbhid->error_work);
 
 	usbhid->retry_delay = 0;
 	spin_unlock_irq(&usbhid->lock);
diff --git a/drivers/hid/usbhid/usbhid.h b/drivers/hid/usbhid/usbhid.h
index 75fe85d3d27a..530dca7e5ef3 100644
--- a/drivers/hid/usbhid/usbhid.h
+++ b/drivers/hid/usbhid/usbhid.h
@@ -86,7 +86,7 @@ struct usbhid_device {
 	struct timer_list io_retry;                                     /* Retry timer */
 	unsigned long stop_retry;                                       /* Time to give up, in jiffies */
 	unsigned int retry_delay;                                       /* Delay length in ms */
-	struct work_struct reset_work;                                  /* Task context for resets */
+	struct work_struct error_work;                                  /* Task context for earing halts*/
 	wait_queue_head_t wait;						/* For sleeping */
 };
 
-- 
2.53.0


      reply	other threads:[~2026-03-25 10:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-25 10:31 [RFC 1/2] hid: usbhid: call usb_queue_reset_device directly Oliver Neukum
2026-03-25 10:31 ` Oliver Neukum [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=20260325103210.198820-2-oneukum@suse.com \
    --to=oneukum@suse.com \
    --cc=linux-usb@vger.kernel.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