Skip to content

Commit 2c02850

Browse files
dtorgregkh
authored andcommitted
HID: do not use down_interruptible() when unbinding devices
[ Upstream commit f2145f8 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 51b7499 commit 2c02850

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

‎drivers/hid/hid-core.c‎

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2306,12 +2306,8 @@ static int hid_device_remove(struct device *dev)
23062306
{
23072307
struct hid_device *hdev = to_hid_device(dev);
23082308
struct hid_driver *hdrv;
2309-
int ret = 0;
23102309

2311-
if (down_interruptible(&hdev->driver_input_lock)) {
2312-
ret = -EINTR;
2313-
goto end;
2314-
}
2310+
down(&hdev->driver_input_lock);
23152311
hdev->io_started = false;
23162312

23172313
hdrv = hdev->driver;
@@ -2326,8 +2322,8 @@ static int hid_device_remove(struct device *dev)
23262322

23272323
if (!hdev->io_started)
23282324
up(&hdev->driver_input_lock);
2329-
end:
2330-
return ret;
2325+
2326+
return 0;
23312327
}
23322328

23332329
static ssize_t modalias_show(struct device *dev, struct device_attribute *a,

0 commit comments

Comments
 (0)