Commit f2145f8d authored by Dmitry Torokhov's avatar Dmitry Torokhov Committed by Jiri Kosina

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: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent efd8929b
...@@ -2303,12 +2303,8 @@ static int hid_device_remove(struct device *dev) ...@@ -2303,12 +2303,8 @@ static int hid_device_remove(struct device *dev)
{ {
struct hid_device *hdev = to_hid_device(dev); struct hid_device *hdev = to_hid_device(dev);
struct hid_driver *hdrv; struct hid_driver *hdrv;
int ret = 0;
if (down_interruptible(&hdev->driver_input_lock)) { down(&hdev->driver_input_lock);
ret = -EINTR;
goto end;
}
hdev->io_started = false; hdev->io_started = false;
hdrv = hdev->driver; hdrv = hdev->driver;
...@@ -2323,8 +2319,8 @@ static int hid_device_remove(struct device *dev) ...@@ -2323,8 +2319,8 @@ static int hid_device_remove(struct device *dev)
if (!hdev->io_started) if (!hdev->io_started)
up(&hdev->driver_input_lock); up(&hdev->driver_input_lock);
end:
return ret; return 0;
} }
static ssize_t modalias_show(struct device *dev, struct device_attribute *a, static ssize_t modalias_show(struct device *dev, struct device_attribute *a,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment