Skip to content

Commit f2145f8

Browse files
dtorJiri Kosina
authored andcommitted
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 <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent efd8929 commit f2145f8

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

drivers/hid/hid-core.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2303,12 +2303,8 @@ static int hid_device_remove(struct device *dev)
23032303
{
23042304
struct hid_device *hdev = to_hid_device(dev);
23052305
struct hid_driver *hdrv;
2306-
int ret = 0;
23072306

2308-
if (down_interruptible(&hdev->driver_input_lock)) {
2309-
ret = -EINTR;
2310-
goto end;
2311-
}
2307+
down(&hdev->driver_input_lock);
23122308
hdev->io_started = false;
23132309

23142310
hdrv = hdev->driver;
@@ -2323,8 +2319,8 @@ static int hid_device_remove(struct device *dev)
23232319

23242320
if (!hdev->io_started)
23252321
up(&hdev->driver_input_lock);
2326-
end:
2327-
return ret;
2322+
2323+
return 0;
23282324
}
23292325

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

0 commit comments

Comments
 (0)