aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/vt6656
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/vt6656')
-rw-r--r--drivers/staging/vt6656/device.h4
-rw-r--r--drivers/staging/vt6656/main_usb.c30
-rw-r--r--drivers/staging/vt6656/power.c2
-rw-r--r--drivers/staging/vt6656/rf.c4
-rw-r--r--drivers/staging/vt6656/usbpipe.c21
5 files changed, 29 insertions, 32 deletions
diff --git a/drivers/staging/vt6656/device.h b/drivers/staging/vt6656/device.h
index 76b5f4127f95..4832666cc580 100644
--- a/drivers/staging/vt6656/device.h
+++ b/drivers/staging/vt6656/device.h
@@ -259,8 +259,8 @@ enum {
};
/* flags for options */
-#define DEVICE_FLAGS_UNPLUG BIT(0)
-#define DEVICE_FLAGS_DISCONNECTED BIT(1)
+#define DEVICE_FLAGS_UNPLUG 0
+#define DEVICE_FLAGS_DISCONNECTED 1
struct vnt_private {
/* mac80211 */
diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c
index ee8d1e1a24c2..f9afab77b79f 100644
--- a/drivers/staging/vt6656/main_usb.c
+++ b/drivers/staging/vt6656/main_usb.c
@@ -74,10 +74,10 @@ MODULE_PARM_DESC(tx_buffers, "Number of receive usb tx buffers");
#define LONG_RETRY_DEF 4
/* BasebandType[] baseband type selected
- 0: indicate 802.11a type
- 1: indicate 802.11b type
- 2: indicate 802.11g type
-*/
+ * 0: indicate 802.11a type
+ * 1: indicate 802.11b type
+ * 2: indicate 802.11g type
+ */
#define BBP_TYPE_DEF 2
@@ -284,7 +284,8 @@ static int vnt_init_registers(struct vnt_private *priv)
calib_rx_iq = priv->eeprom[EEP_OFS_CALIB_RX_IQ];
if (calib_tx_iq || calib_tx_dc || calib_rx_iq) {
/* CR255, enable TX/RX IQ and
- DC compensation mode */
+ * DC compensation mode
+ */
vnt_control_out_u8(priv,
MESSAGE_REQUEST_BBREG,
0xff,
@@ -306,7 +307,8 @@ static int vnt_init_registers(struct vnt_private *priv)
calib_rx_iq);
} else {
/* CR255, turn off
- BB Calibration compensation */
+ * BB Calibration compensation
+ */
vnt_control_out_u8(priv,
MESSAGE_REQUEST_BBREG,
0xff,
@@ -429,7 +431,7 @@ static bool vnt_alloc_bufs(struct vnt_private *priv)
for (ii = 0; ii < priv->num_tx_context; ii++) {
tx_context = kmalloc(sizeof(struct vnt_usb_send_context),
GFP_KERNEL);
- if (tx_context == NULL)
+ if (!tx_context)
goto free_tx;
priv->tx_context[ii] = tx_context;
@@ -437,7 +439,7 @@ static bool vnt_alloc_bufs(struct vnt_private *priv)
tx_context->pkt_no = ii;
/* allocate URBs */
- tx_context->urb = usb_alloc_urb(0, GFP_ATOMIC);
+ tx_context->urb = usb_alloc_urb(0, GFP_KERNEL);
if (!tx_context->urb) {
dev_err(&priv->usb->dev, "alloc tx urb failed\n");
goto free_tx;
@@ -459,14 +461,14 @@ static bool vnt_alloc_bufs(struct vnt_private *priv)
rcb->priv = priv;
/* allocate URBs */
- rcb->urb = usb_alloc_urb(0, GFP_ATOMIC);
- if (rcb->urb == NULL) {
+ rcb->urb = usb_alloc_urb(0, GFP_KERNEL);
+ if (!rcb->urb) {
dev_err(&priv->usb->dev, "Failed to alloc rx urb\n");
goto free_rx_tx;
}
rcb->skb = dev_alloc_skb(priv->rx_buf_sz);
- if (rcb->skb == NULL)
+ if (!rcb->skb)
goto free_rx_tx;
rcb->in_use = false;
@@ -476,14 +478,14 @@ static bool vnt_alloc_bufs(struct vnt_private *priv)
goto free_rx_tx;
}
- priv->interrupt_urb = usb_alloc_urb(0, GFP_ATOMIC);
- if (priv->interrupt_urb == NULL) {
+ priv->interrupt_urb = usb_alloc_urb(0, GFP_KERNEL);
+ if (!priv->interrupt_urb) {
dev_err(&priv->usb->dev, "Failed to alloc int urb\n");
goto free_rx_tx;
}
priv->int_buf.data_buf = kmalloc(MAX_INTERRUPT_SIZE, GFP_KERNEL);
- if (priv->int_buf.data_buf == NULL) {
+ if (!priv->int_buf.data_buf) {
usb_free_urb(priv->interrupt_urb);
goto free_rx_tx;
}
diff --git a/drivers/staging/vt6656/power.c b/drivers/staging/vt6656/power.c
index c025dab0f62c..e322b7d8c617 100644
--- a/drivers/staging/vt6656/power.c
+++ b/drivers/staging/vt6656/power.c
@@ -103,7 +103,7 @@ void vnt_disable_power_saving(struct vnt_private *priv)
/* disable power saving hw function */
vnt_control_out(priv, MESSAGE_TYPE_DISABLE_PS, 0,
- 0, 0, NULL);
+ 0, 0, NULL);
/* clear AutoSleep */
vnt_mac_reg_bits_off(priv, MAC_REG_PSCFG, PSCFG_AUTOSLEEP);
diff --git a/drivers/staging/vt6656/rf.c b/drivers/staging/vt6656/rf.c
index 816206c92f57..79a3108719a6 100644
--- a/drivers/staging/vt6656/rf.c
+++ b/drivers/staging/vt6656/rf.c
@@ -917,8 +917,8 @@ void vnt_rf_table_download(struct vnt_private *priv)
if (priv->rf_type == RF_AIROHA7230) {
length1 = CB_AL7230_INIT_SEQ * 3;
length2 = CB_MAX_CHANNEL * 3;
- addr1 = &(al7230_init_table_amode[0][0]);
- addr2 = &(al7230_channel_table2[0][0]);
+ addr1 = &al7230_init_table_amode[0][0];
+ addr2 = &al7230_channel_table2[0][0];
memcpy(array, addr1, length1);
diff --git a/drivers/staging/vt6656/usbpipe.c b/drivers/staging/vt6656/usbpipe.c
index 351a99f3d684..f546553de66f 100644
--- a/drivers/staging/vt6656/usbpipe.c
+++ b/drivers/staging/vt6656/usbpipe.c
@@ -101,9 +101,9 @@ void vnt_control_in_u8(struct vnt_private *priv, u8 reg, u8 reg_off, u8 *data)
static void vnt_start_interrupt_urb_complete(struct urb *urb)
{
struct vnt_private *priv = urb->context;
- int status;
+ int status = urb->status;
- switch (urb->status) {
+ switch (status) {
case 0:
case -ETIMEDOUT:
break;
@@ -116,9 +116,7 @@ static void vnt_start_interrupt_urb_complete(struct urb *urb)
break;
}
- status = urb->status;
-
- if (status != STATUS_SUCCESS) {
+ if (status) {
priv->int_buf.in_use = false;
dev_dbg(&priv->usb->dev, "%s status = %d\n", __func__, status);
@@ -207,10 +205,9 @@ static void vnt_submit_rx_urb_complete(struct urb *urb)
int vnt_submit_rx_urb(struct vnt_private *priv, struct vnt_rcb *rcb)
{
int status = 0;
- struct urb *urb;
+ struct urb *urb = rcb->urb;
- urb = rcb->urb;
- if (rcb->skb == NULL) {
+ if (!rcb->skb) {
dev_dbg(&priv->usb->dev, "rcb->skb is null\n");
return status;
}
@@ -224,7 +221,7 @@ int vnt_submit_rx_urb(struct vnt_private *priv, struct vnt_rcb *rcb)
rcb);
status = usb_submit_urb(urb, GFP_ATOMIC);
- if (status != 0) {
+ if (status) {
dev_dbg(&priv->usb->dev, "Submit Rx URB failed %d\n", status);
return STATUS_FAILURE;
}
@@ -269,15 +266,13 @@ int vnt_tx_context(struct vnt_private *priv,
struct vnt_usb_send_context *context)
{
int status;
- struct urb *urb;
+ struct urb *urb = context->urb;
if (test_bit(DEVICE_FLAGS_DISCONNECTED, &priv->flags)) {
context->in_use = false;
return STATUS_RESOURCES;
}
- urb = context->urb;
-
usb_fill_bulk_urb(urb,
priv->usb,
usb_sndbulkpipe(priv->usb, 3),
@@ -287,7 +282,7 @@ int vnt_tx_context(struct vnt_private *priv,
context);
status = usb_submit_urb(urb, GFP_ATOMIC);
- if (status != 0) {
+ if (status) {
dev_dbg(&priv->usb->dev, "Submit Tx URB failed %d\n", status);
context->in_use = false;