.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * DVB USB framework |
---|
3 | 4 | * |
---|
4 | 5 | * Copyright (C) 2004-6 Patrick Boettcher <patrick.boettcher@posteo.de> |
---|
5 | 6 | * 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. |
---|
20 | 7 | */ |
---|
21 | 8 | |
---|
22 | 9 | #include "dvb_usb_common.h" |
---|
.. | .. |
---|
37 | 24 | ret = usb_bulk_msg(d->udev, usb_sndbulkpipe(d->udev, |
---|
38 | 25 | d->props->generic_bulk_ctrl_endpoint), wbuf, wlen, |
---|
39 | 26 | &actual_length, 2000); |
---|
40 | | - if (ret < 0) |
---|
| 27 | + if (ret) { |
---|
41 | 28 | dev_err(&d->udev->dev, "%s: usb_bulk_msg() failed=%d\n", |
---|
42 | 29 | 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 | + } |
---|
45 | 37 | |
---|
46 | | - /* an answer is expected, and no error before */ |
---|
47 | | - if (!ret && rbuf && rlen) { |
---|
| 38 | + /* an answer is expected */ |
---|
| 39 | + if (rbuf && rlen) { |
---|
48 | 40 | if (d->props->generic_bulk_ctrl_delay) |
---|
49 | 41 | usleep_range(d->props->generic_bulk_ctrl_delay, |
---|
50 | 42 | d->props->generic_bulk_ctrl_delay |
---|