hc
2024-05-10 23fa18eaa71266feff7ba8d83022d9e1cc83c65a
kernel/drivers/media/usb/dvb-usb-v2/dvb_usb_urb.c
....@@ -1,22 +1,9 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * DVB USB framework
34 *
45 * Copyright (C) 2004-6 Patrick Boettcher <patrick.boettcher@posteo.de>
56 * Copyright (C) 2012 Antti Palosaari <crope@iki.fi>
6
- *
7
- * This program is free software; you can redistribute it and/or modify
8
- * it under the terms of the GNU General Public License as published by
9
- * the Free Software Foundation; either version 2 of the License, or
10
- * (at your option) any later version.
11
- *
12
- * This program is distributed in the hope that it will be useful,
13
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- * GNU General Public License for more details.
16
- *
17
- * You should have received a copy of the GNU General Public License along
18
- * with this program; if not, write to the Free Software Foundation, Inc.,
19
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
207 */
218
229 #include "dvb_usb_common.h"
....@@ -37,14 +24,19 @@
3724 ret = usb_bulk_msg(d->udev, usb_sndbulkpipe(d->udev,
3825 d->props->generic_bulk_ctrl_endpoint), wbuf, wlen,
3926 &actual_length, 2000);
40
- if (ret < 0)
27
+ if (ret) {
4128 dev_err(&d->udev->dev, "%s: usb_bulk_msg() failed=%d\n",
4229 KBUILD_MODNAME, ret);
43
- else
44
- ret = actual_length != wlen ? -EIO : 0;
30
+ return ret;
31
+ }
32
+ if (actual_length != wlen) {
33
+ dev_err(&d->udev->dev, "%s: usb_bulk_msg() write length=%d, actual=%d\n",
34
+ KBUILD_MODNAME, wlen, actual_length);
35
+ return -EIO;
36
+ }
4537
46
- /* an answer is expected, and no error before */
47
- if (!ret && rbuf && rlen) {
38
+ /* an answer is expected */
39
+ if (rbuf && rlen) {
4840 if (d->props->generic_bulk_ctrl_delay)
4941 usleep_range(d->props->generic_bulk_ctrl_delay,
5042 d->props->generic_bulk_ctrl_delay