diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2021-03-20 03:27:16 +0300 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2021-05-05 15:24:56 +0300 |
commit | f2145f8dc566c4f3b5a8deb58dcd12bed4e20194 (patch) | |
tree | 46c430e4c0817d305b26ef1c9526eab79228e606 /drivers/hid/hid-core.c | |
parent | efd8929b9eec1cde120abb36d76dd00ff6711023 (diff) |
HID: do not use down_interruptible() when unbinding devices
Action of unbinding driver from a device is not cancellable and should not
fail, and driver core does not pay attention to the result of "remove"
method, therefore using down_interruptible() in hid_device_remove() does
not make sense.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hid-core.c')
-rw-r--r-- | drivers/hid/hid-core.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 0ae9f6df59d1..ff695ec520f8 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -2303,12 +2303,8 @@ static int hid_device_remove(struct device *dev) { struct hid_device *hdev = to_hid_device(dev); struct hid_driver *hdrv; - int ret = 0; - if (down_interruptible(&hdev->driver_input_lock)) { - ret = -EINTR; - goto end; - } + down(&hdev->driver_input_lock); hdev->io_started = false; hdrv = hdev->driver; @@ -2323,8 +2319,8 @@ static int hid_device_remove(struct device *dev) if (!hdev->io_started) up(&hdev->driver_input_lock); -end: - return ret; + + return 0; } static ssize_t modalias_show(struct device *dev, struct device_attribute *a, |