Skip to content

Commit 7da37cd

Browse files
committed
Merge tag 'staging-5.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
Pull staging fixes from Greg KH: "Here are some small staging driver fixes for 5.5-rc6. Nothing major here, just some small fixes for a comedi driver, the vt6656 driver, and a new device id for the rtl8188eu driver. All of these have been in linux-next for a while with no reported issues" * tag 'staging-5.5-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: staging: rtl8188eu: Add device code for TP-Link TL-WN727N v5.21 staging: comedi: adv_pci1710: fix AI channels 16-31 for PCI-1713 staging: vt6656: set usb_set_intfdata on driver fail. staging: vt6656: remove bool from vnt_radio_power_on ret staging: vt6656: limit reg output to block size staging: vt6656: correct return of vnt_init_registers. staging: vt6656: Fix non zero logical return of, usb_control_msg
2 parents 5a96c0b + 58dcc5b commit 7da37cd

File tree

9 files changed

+38
-8
lines changed

9 files changed

+38
-8
lines changed

drivers/staging/comedi/drivers/adv_pci1710.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@
4646
#define PCI171X_RANGE_UNI BIT(4)
4747
#define PCI171X_RANGE_GAIN(x) (((x) & 0x7) << 0)
4848
#define PCI171X_MUX_REG 0x04 /* W: A/D multiplexor control */
49-
#define PCI171X_MUX_CHANH(x) (((x) & 0xf) << 8)
50-
#define PCI171X_MUX_CHANL(x) (((x) & 0xf) << 0)
49+
#define PCI171X_MUX_CHANH(x) (((x) & 0xff) << 8)
50+
#define PCI171X_MUX_CHANL(x) (((x) & 0xff) << 0)
5151
#define PCI171X_MUX_CHAN(x) (PCI171X_MUX_CHANH(x) | PCI171X_MUX_CHANL(x))
5252
#define PCI171X_STATUS_REG 0x06 /* R: status register */
5353
#define PCI171X_STATUS_IRQ BIT(11) /* 1=IRQ occurred */

drivers/staging/rtl8188eu/os_dep/usb_intf.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ static const struct usb_device_id rtw_usb_id_tbl[] = {
3737
{USB_DEVICE(0x2001, 0x3311)}, /* DLink GO-USB-N150 REV B1 */
3838
{USB_DEVICE(0x2001, 0x331B)}, /* D-Link DWA-121 rev B1 */
3939
{USB_DEVICE(0x2357, 0x010c)}, /* TP-Link TL-WN722N v2 */
40+
{USB_DEVICE(0x2357, 0x0111)}, /* TP-Link TL-WN727N v5.21 */
4041
{USB_DEVICE(0x0df6, 0x0076)}, /* Sitecom N150 v2 */
4142
{USB_DEVICE(USB_VENDER_ID_REALTEK, 0xffef)}, /* Rosewill RNX-N150NUB */
4243
{} /* Terminating entry */

drivers/staging/vt6656/baseband.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,8 +449,8 @@ int vnt_vt3184_init(struct vnt_private *priv)
449449

450450
memcpy(array, addr, length);
451451

452-
ret = vnt_control_out(priv, MESSAGE_TYPE_WRITE, 0,
453-
MESSAGE_REQUEST_BBREG, length, array);
452+
ret = vnt_control_out_blocks(priv, VNT_REG_BLOCK_SIZE,
453+
MESSAGE_REQUEST_BBREG, length, array);
454454
if (ret)
455455
goto end;
456456

drivers/staging/vt6656/card.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,7 @@ int vnt_radio_power_off(struct vnt_private *priv)
719719
*/
720720
int vnt_radio_power_on(struct vnt_private *priv)
721721
{
722-
int ret = true;
722+
int ret = 0;
723723

724724
vnt_exit_deep_sleep(priv);
725725

drivers/staging/vt6656/device.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ struct vnt_private {
259259
u8 mac_hw;
260260
/* netdev */
261261
struct usb_device *usb;
262+
struct usb_interface *intf;
262263

263264
u64 tsf_time;
264265
u8 rx_rate;

drivers/staging/vt6656/main_usb.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -949,7 +949,7 @@ static const struct ieee80211_ops vnt_mac_ops = {
949949

950950
int vnt_init(struct vnt_private *priv)
951951
{
952-
if (!(vnt_init_registers(priv)))
952+
if (vnt_init_registers(priv))
953953
return -EAGAIN;
954954

955955
SET_IEEE80211_PERM_ADDR(priv->hw, priv->permanent_net_addr);
@@ -992,6 +992,7 @@ vt6656_probe(struct usb_interface *intf, const struct usb_device_id *id)
992992
priv = hw->priv;
993993
priv->hw = hw;
994994
priv->usb = udev;
995+
priv->intf = intf;
995996

996997
vnt_set_options(priv);
997998

drivers/staging/vt6656/usbpipe.c

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ int vnt_control_out(struct vnt_private *priv, u8 request, u16 value,
5959

6060
kfree(usb_buffer);
6161

62-
if (ret >= 0 && ret < (int)length)
62+
if (ret == (int)length)
63+
ret = 0;
64+
else
6365
ret = -EIO;
6466

6567
end_unlock:
@@ -74,6 +76,23 @@ int vnt_control_out_u8(struct vnt_private *priv, u8 reg, u8 reg_off, u8 data)
7476
reg_off, reg, sizeof(u8), &data);
7577
}
7678

79+
int vnt_control_out_blocks(struct vnt_private *priv,
80+
u16 block, u8 reg, u16 length, u8 *data)
81+
{
82+
int ret = 0, i;
83+
84+
for (i = 0; i < length; i += block) {
85+
u16 len = min_t(int, length - i, block);
86+
87+
ret = vnt_control_out(priv, MESSAGE_TYPE_WRITE,
88+
i, reg, len, data + i);
89+
if (ret)
90+
goto end;
91+
}
92+
end:
93+
return ret;
94+
}
95+
7796
int vnt_control_in(struct vnt_private *priv, u8 request, u16 value,
7897
u16 index, u16 length, u8 *buffer)
7998
{
@@ -103,7 +122,9 @@ int vnt_control_in(struct vnt_private *priv, u8 request, u16 value,
103122

104123
kfree(usb_buffer);
105124

106-
if (ret >= 0 && ret < (int)length)
125+
if (ret == (int)length)
126+
ret = 0;
127+
else
107128
ret = -EIO;
108129

109130
end_unlock:

drivers/staging/vt6656/usbpipe.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818

1919
#include "device.h"
2020

21+
#define VNT_REG_BLOCK_SIZE 64
22+
2123
int vnt_control_out(struct vnt_private *priv, u8 request, u16 value,
2224
u16 index, u16 length, u8 *buffer);
2325
int vnt_control_in(struct vnt_private *priv, u8 request, u16 value,
@@ -26,6 +28,9 @@ int vnt_control_in(struct vnt_private *priv, u8 request, u16 value,
2628
int vnt_control_out_u8(struct vnt_private *priv, u8 reg, u8 ref_off, u8 data);
2729
int vnt_control_in_u8(struct vnt_private *priv, u8 reg, u8 reg_off, u8 *data);
2830

31+
int vnt_control_out_blocks(struct vnt_private *priv,
32+
u16 block, u8 reg, u16 len, u8 *data);
33+
2934
int vnt_start_interrupt_urb(struct vnt_private *priv);
3035
int vnt_submit_rx_urb(struct vnt_private *priv, struct vnt_rcb *rcb);
3136
int vnt_tx_context(struct vnt_private *priv,

drivers/staging/vt6656/wcmd.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ void vnt_run_command(struct work_struct *work)
9999
if (vnt_init(priv)) {
100100
/* If fail all ends TODO retry */
101101
dev_err(&priv->usb->dev, "failed to start\n");
102+
usb_set_intfdata(priv->intf, NULL);
102103
ieee80211_free_hw(priv->hw);
103104
return;
104105
}

0 commit comments

Comments
 (0)