On Thu, Apr 13 2023 at 06:13:05 PM +02:00:00, Benjamin Tissoires
<benjamin.tissoires@xxxxxxxxxx> wrote:
What's the point of keeping it opened for the lifetime of the device?
Do
you really need this?
+ if (error) {
+ dev_err(&hdev->dev, "hw open failed\n");
+ hid_hw_stop(hdev);
+ return error;
+ }
+
+ return 0;
+}
+
+static void shanwan_remove(struct hid_device *hdev)
+{
+ hid_hw_close(hdev);
If you can drop the last hid_hw_open/close, then you can entirely skip
the ->remove().
Would hid_hw_request work without open device?