Skip to content

Commit

Permalink
Merge tag 'staging-5.5-rc6' of git://git.kernel.org/pub/scm/linux/ker…
Browse files Browse the repository at this point in the history
…nel/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
  • Loading branch information
Linus Torvalds committed Jan 10, 2020
2 parents 5a96c0b + 58dcc5b commit 7da37cd
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 8 deletions.
4 changes: 2 additions & 2 deletions drivers/staging/comedi/drivers/adv_pci1710.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
#define PCI171X_RANGE_UNI BIT(4)
#define PCI171X_RANGE_GAIN(x) (((x) & 0x7) << 0)
#define PCI171X_MUX_REG 0x04 /* W: A/D multiplexor control */
#define PCI171X_MUX_CHANH(x) (((x) & 0xf) << 8)
#define PCI171X_MUX_CHANL(x) (((x) & 0xf) << 0)
#define PCI171X_MUX_CHANH(x) (((x) & 0xff) << 8)
#define PCI171X_MUX_CHANL(x) (((x) & 0xff) << 0)
#define PCI171X_MUX_CHAN(x) (PCI171X_MUX_CHANH(x) | PCI171X_MUX_CHANL(x))
#define PCI171X_STATUS_REG 0x06 /* R: status register */
#define PCI171X_STATUS_IRQ BIT(11) /* 1=IRQ occurred */
Expand Down
1 change: 1 addition & 0 deletions drivers/staging/rtl8188eu/os_dep/usb_intf.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ static const struct usb_device_id rtw_usb_id_tbl[] = {
{USB_DEVICE(0x2001, 0x3311)}, /* DLink GO-USB-N150 REV B1 */
{USB_DEVICE(0x2001, 0x331B)}, /* D-Link DWA-121 rev B1 */
{USB_DEVICE(0x2357, 0x010c)}, /* TP-Link TL-WN722N v2 */
{USB_DEVICE(0x2357, 0x0111)}, /* TP-Link TL-WN727N v5.21 */
{USB_DEVICE(0x0df6, 0x0076)}, /* Sitecom N150 v2 */
{USB_DEVICE(USB_VENDER_ID_REALTEK, 0xffef)}, /* Rosewill RNX-N150NUB */
{} /* Terminating entry */
Expand Down
4 changes: 2 additions & 2 deletions drivers/staging/vt6656/baseband.c
Original file line number Diff line number Diff line change
Expand Up @@ -449,8 +449,8 @@ int vnt_vt3184_init(struct vnt_private *priv)

memcpy(array, addr, length);

ret = vnt_control_out(priv, MESSAGE_TYPE_WRITE, 0,
MESSAGE_REQUEST_BBREG, length, array);
ret = vnt_control_out_blocks(priv, VNT_REG_BLOCK_SIZE,
MESSAGE_REQUEST_BBREG, length, array);
if (ret)
goto end;

Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/vt6656/card.c
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ int vnt_radio_power_off(struct vnt_private *priv)
*/
int vnt_radio_power_on(struct vnt_private *priv)
{
int ret = true;
int ret = 0;

vnt_exit_deep_sleep(priv);

Expand Down
1 change: 1 addition & 0 deletions drivers/staging/vt6656/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ struct vnt_private {
u8 mac_hw;
/* netdev */
struct usb_device *usb;
struct usb_interface *intf;

u64 tsf_time;
u8 rx_rate;
Expand Down
3 changes: 2 additions & 1 deletion drivers/staging/vt6656/main_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -949,7 +949,7 @@ static const struct ieee80211_ops vnt_mac_ops = {

int vnt_init(struct vnt_private *priv)
{
if (!(vnt_init_registers(priv)))
if (vnt_init_registers(priv))
return -EAGAIN;

SET_IEEE80211_PERM_ADDR(priv->hw, priv->permanent_net_addr);
Expand Down Expand Up @@ -992,6 +992,7 @@ vt6656_probe(struct usb_interface *intf, const struct usb_device_id *id)
priv = hw->priv;
priv->hw = hw;
priv->usb = udev;
priv->intf = intf;

vnt_set_options(priv);

Expand Down
25 changes: 23 additions & 2 deletions drivers/staging/vt6656/usbpipe.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ int vnt_control_out(struct vnt_private *priv, u8 request, u16 value,

kfree(usb_buffer);

if (ret >= 0 && ret < (int)length)
if (ret == (int)length)
ret = 0;
else
ret = -EIO;

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

int vnt_control_out_blocks(struct vnt_private *priv,
u16 block, u8 reg, u16 length, u8 *data)
{
int ret = 0, i;

for (i = 0; i < length; i += block) {
u16 len = min_t(int, length - i, block);

ret = vnt_control_out(priv, MESSAGE_TYPE_WRITE,
i, reg, len, data + i);
if (ret)
goto end;
}
end:
return ret;
}

int vnt_control_in(struct vnt_private *priv, u8 request, u16 value,
u16 index, u16 length, u8 *buffer)
{
Expand Down Expand Up @@ -103,7 +122,9 @@ int vnt_control_in(struct vnt_private *priv, u8 request, u16 value,

kfree(usb_buffer);

if (ret >= 0 && ret < (int)length)
if (ret == (int)length)
ret = 0;
else
ret = -EIO;

end_unlock:
Expand Down
5 changes: 5 additions & 0 deletions drivers/staging/vt6656/usbpipe.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

#include "device.h"

#define VNT_REG_BLOCK_SIZE 64

int vnt_control_out(struct vnt_private *priv, u8 request, u16 value,
u16 index, u16 length, u8 *buffer);
int vnt_control_in(struct vnt_private *priv, u8 request, u16 value,
Expand All @@ -26,6 +28,9 @@ int vnt_control_in(struct vnt_private *priv, u8 request, u16 value,
int vnt_control_out_u8(struct vnt_private *priv, u8 reg, u8 ref_off, u8 data);
int vnt_control_in_u8(struct vnt_private *priv, u8 reg, u8 reg_off, u8 *data);

int vnt_control_out_blocks(struct vnt_private *priv,
u16 block, u8 reg, u16 len, u8 *data);

int vnt_start_interrupt_urb(struct vnt_private *priv);
int vnt_submit_rx_urb(struct vnt_private *priv, struct vnt_rcb *rcb);
int vnt_tx_context(struct vnt_private *priv,
Expand Down
1 change: 1 addition & 0 deletions drivers/staging/vt6656/wcmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ void vnt_run_command(struct work_struct *work)
if (vnt_init(priv)) {
/* If fail all ends TODO retry */
dev_err(&priv->usb->dev, "failed to start\n");
usb_set_intfdata(priv->intf, NULL);
ieee80211_free_hw(priv->hw);
return;
}
Expand Down

0 comments on commit 7da37cd

Please sign in to comment.