aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/gdm72xx
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/gdm72xx')
-rw-r--r--drivers/staging/gdm72xx/gdm_qos.c6
-rw-r--r--drivers/staging/gdm72xx/gdm_sdio.c8
-rw-r--r--drivers/staging/gdm72xx/gdm_usb.c31
-rw-r--r--drivers/staging/gdm72xx/gdm_wimax.c18
-rw-r--r--drivers/staging/gdm72xx/gdm_wimax.h1
-rw-r--r--drivers/staging/gdm72xx/netlink_k.c1
-rw-r--r--drivers/staging/gdm72xx/sdio_boot.c1
-rw-r--r--drivers/staging/gdm72xx/usb_boot.c3
8 files changed, 27 insertions, 42 deletions
diff --git a/drivers/staging/gdm72xx/gdm_qos.c b/drivers/staging/gdm72xx/gdm_qos.c
index 0217680ec545..80bde053fbc2 100644
--- a/drivers/staging/gdm72xx/gdm_qos.c
+++ b/drivers/staging/gdm72xx/gdm_qos.c
@@ -11,7 +11,6 @@
* GNU General Public License for more details.
*/
-#include <linux/version.h>
#include <linux/etherdevice.h>
#include <asm/byteorder.h>
@@ -196,7 +195,7 @@ static u32 chk_ipv4_rule(struct gdm_wimax_csr_s *csr, u8 *Stream, u8 *port)
return 0;
}
-static u32 get_qos_index(struct nic *nic, u8* iph, u8* tcpudph)
+static u32 get_qos_index(struct nic *nic, u8 *iph, u8 *tcpudph)
{
u32 IP_Ver, Header_Len, i;
struct qos_cb_s *qcb = &nic->qos;
@@ -241,8 +240,7 @@ static u32 extract_qos_list(struct nic *nic, struct list_head *head)
qcb->csr[i].QoSBufCount++;
if (!list_empty(&qcb->qos_list[i]))
- wprintk("QoS Index(%d) "
- "is piled!!\n", i);
+ wprintk("QoS Index(%d) is piled!!\n", i);
}
}
}
diff --git a/drivers/staging/gdm72xx/gdm_sdio.c b/drivers/staging/gdm72xx/gdm_sdio.c
index e1a3dd2fc4af..3e43c012ef27 100644
--- a/drivers/staging/gdm72xx/gdm_sdio.c
+++ b/drivers/staging/gdm72xx/gdm_sdio.c
@@ -14,7 +14,6 @@
#include <linux/module.h>
#include <linux/init.h>
#include <linux/kernel.h>
-#include <linux/version.h>
#include <linux/mmc/core.h>
#include <linux/mmc/card.h>
@@ -665,20 +664,17 @@ static int sdio_wimax_probe(struct sdio_func *func,
if (ret)
return ret;
- phy_dev = kmalloc(sizeof(*phy_dev), GFP_KERNEL);
+ phy_dev = kzalloc(sizeof(*phy_dev), GFP_KERNEL);
if (phy_dev == NULL) {
ret = -ENOMEM;
goto out;
}
- sdev = kmalloc(sizeof(*sdev), GFP_KERNEL);
+ sdev = kzalloc(sizeof(*sdev), GFP_KERNEL);
if (sdev == NULL) {
ret = -ENOMEM;
goto out;
}
- memset(phy_dev, 0, sizeof(*phy_dev));
- memset(sdev, 0, sizeof(*sdev));
-
phy_dev->priv_dev = (void *)sdev;
phy_dev->send_func = gdm_sdio_send;
phy_dev->rcv_func = gdm_sdio_receive;
diff --git a/drivers/staging/gdm72xx/gdm_usb.c b/drivers/staging/gdm72xx/gdm_usb.c
index 1e9dc0d90362..d48d49c145ee 100644
--- a/drivers/staging/gdm72xx/gdm_usb.c
+++ b/drivers/staging/gdm72xx/gdm_usb.c
@@ -12,10 +12,10 @@
*/
#include <linux/module.h>
-#include <linux/version.h>
#include <linux/kernel.h>
#include <linux/usb.h>
#include <asm/byteorder.h>
+#include <linux/kthread.h>
#include "gdm_usb.h"
#include "gdm_wimax.h"
@@ -270,20 +270,17 @@ static void release_usb(struct usbwm_dev *udev)
}
}
-static void gdm_usb_send_complete(struct urb *urb)
+static void __gdm_usb_send_complete(struct urb *urb)
{
struct usb_tx *t = urb->context;
struct tx_cxt *tx = t->tx_cxt;
u8 *pkt = t->buf;
u16 cmd_evt;
- unsigned long flags;
/* Completion by usb_unlink_urb */
if (urb->status == -ECONNRESET)
return;
- spin_lock_irqsave(&tx->lock, flags);
-
if (t->callback)
t->callback(t->cb_data);
@@ -295,7 +292,16 @@ static void gdm_usb_send_complete(struct urb *urb)
put_tx_struct(tx, t);
else
free_tx_struct(t);
+}
+static void gdm_usb_send_complete(struct urb *urb)
+{
+ struct usb_tx *t = urb->context;
+ struct tx_cxt *tx = t->tx_cxt;
+ unsigned long flags;
+
+ spin_lock_irqsave(&tx->lock, flags);
+ __gdm_usb_send_complete(urb);
spin_unlock_irqrestore(&tx->lock, flags);
}
@@ -411,7 +417,7 @@ out:
send_fail:
t->callback = NULL;
- gdm_usb_send_complete(t->urb);
+ __gdm_usb_send_complete(t->urb);
spin_unlock_irqrestore(&tx->lock, flags);
return ret;
}
@@ -540,7 +546,7 @@ static void do_pm_control(struct work_struct *work)
if (ret) {
t->callback = NULL;
- gdm_usb_send_complete(t->urb);
+ __gdm_usb_send_complete(t->urb);
}
}
}
@@ -584,20 +590,17 @@ static int gdm_usb_probe(struct usb_interface *intf,
goto out;
}
- phy_dev = kmalloc(sizeof(*phy_dev), GFP_KERNEL);
+ phy_dev = kzalloc(sizeof(*phy_dev), GFP_KERNEL);
if (phy_dev == NULL) {
ret = -ENOMEM;
goto out;
}
- udev = kmalloc(sizeof(*udev), GFP_KERNEL);
+ udev = kzalloc(sizeof(*udev), GFP_KERNEL);
if (udev == NULL) {
ret = -ENOMEM;
goto out;
}
- memset(phy_dev, 0, sizeof(*phy_dev));
- memset(udev, 0, sizeof(*udev));
-
if (idProduct == 0x7205 || idProduct == 0x7206)
udev->padding = GDM7205_PADDING;
else
@@ -742,7 +745,7 @@ static int k_mode_thread(void *arg)
if (ret) {
t->callback = NULL;
- gdm_usb_send_complete(t->urb);
+ __gdm_usb_send_complete(t->urb);
}
}
@@ -775,7 +778,7 @@ static struct usb_driver gdm_usb_driver = {
static int __init usb_gdm_wimax_init(void)
{
#ifdef CONFIG_WIMAX_GDM72XX_K_MODE
- kernel_thread(k_mode_thread, NULL, CLONE_KERNEL);
+ kthread_run(k_mode_thread, NULL, "WiMax_thread");
#endif /* CONFIG_WIMAX_GDM72XX_K_MODE */
return usb_register(&gdm_usb_driver);
}
diff --git a/drivers/staging/gdm72xx/gdm_wimax.c b/drivers/staging/gdm72xx/gdm_wimax.c
index f1936b92533b..0716efc1817d 100644
--- a/drivers/staging/gdm72xx/gdm_wimax.c
+++ b/drivers/staging/gdm72xx/gdm_wimax.c
@@ -11,7 +11,6 @@
* GNU General Public License for more details.
*/
-#include <linux/version.h>
#include <linux/etherdevice.h>
#include <asm/byteorder.h>
#include <linux/ip.h>
@@ -256,17 +255,15 @@ static void gdm_wimax_event_rcv(struct net_device *dev, u16 type, void *msg,
static int gdm_wimax_event_init(void)
{
- if (wm_event.ref_cnt == 0) {
+ if (!wm_event.ref_cnt) {
wm_event.sock = netlink_init(NETLINK_WIMAX,
gdm_wimax_event_rcv);
+ if (wm_event.sock)
+ wm_event.ref_cnt++;
INIT_LIST_HEAD(&wm_event.evtq);
INIT_LIST_HEAD(&wm_event.freeq);
INIT_WORK(&wm_event.ws, __gdm_wimax_event_send);
spin_lock_init(&wm_event.evt_lock);
- }
-
- if (wm_event.sock) {
- wm_event.ref_cnt++;
return 0;
}
@@ -745,13 +742,8 @@ static int gdm_wimax_get_prepared_info(struct net_device *dev, char *buf,
"[%x/%d]\n", __func__, T, L);
return -1;
}
- printk(KERN_INFO
- "MAC change [%02x:%02x:%02x:%02x:%02x:%02x]"
- "->[%02x:%02x:%02x:%02x:%02x:%02x]\n",
- dev->dev_addr[0], dev->dev_addr[1],
- dev->dev_addr[2], dev->dev_addr[3],
- dev->dev_addr[4], dev->dev_addr[5],
- V[0], V[1], V[2], V[3], V[4], V[5]);
+ printk(KERN_INFO "MAC change [%pM]->[%pM]\n",
+ dev->dev_addr, V);
memcpy(dev->dev_addr, V, dev->addr_len);
return 1;
}
diff --git a/drivers/staging/gdm72xx/gdm_wimax.h b/drivers/staging/gdm72xx/gdm_wimax.h
index 023e6492e33d..6ec0ab43e9cc 100644
--- a/drivers/staging/gdm72xx/gdm_wimax.h
+++ b/drivers/staging/gdm72xx/gdm_wimax.h
@@ -15,7 +15,6 @@
#define __GDM_WIMAX_H__
#include <linux/netdevice.h>
-#include <linux/version.h>
#include <linux/types.h>
#include "wm_ioctl.h"
#if defined(CONFIG_WIMAX_GDM72XX_QOS)
diff --git a/drivers/staging/gdm72xx/netlink_k.c b/drivers/staging/gdm72xx/netlink_k.c
index 87c3a07ed80e..3abb31df8f28 100644
--- a/drivers/staging/gdm72xx/netlink_k.c
+++ b/drivers/staging/gdm72xx/netlink_k.c
@@ -11,7 +11,6 @@
* GNU General Public License for more details.
*/
-#include <linux/version.h>
#include <linux/module.h>
#include <linux/etherdevice.h>
#include <linux/netlink.h>
diff --git a/drivers/staging/gdm72xx/sdio_boot.c b/drivers/staging/gdm72xx/sdio_boot.c
index 6ff4dc372522..760efee23d4a 100644
--- a/drivers/staging/gdm72xx/sdio_boot.c
+++ b/drivers/staging/gdm72xx/sdio_boot.c
@@ -12,7 +12,6 @@
*/
#include <linux/module.h>
-#include <linux/version.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/mm.h>
diff --git a/drivers/staging/gdm72xx/usb_boot.c b/drivers/staging/gdm72xx/usb_boot.c
index 5a0e030220dc..fef290c38db6 100644
--- a/drivers/staging/gdm72xx/usb_boot.c
+++ b/drivers/staging/gdm72xx/usb_boot.c
@@ -13,7 +13,6 @@
#include <linux/uaccess.h>
#include <linux/module.h>
-#include <linux/version.h>
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/usb.h>
@@ -175,7 +174,7 @@ int usb_boot(struct usb_device *usbdev, u16 pid)
if (IS_ERR(filp)) {
printk(KERN_ERR "Can't find %s.\n", img_name);
set_fs(fs);
- ret = -ENOENT;
+ ret = PTR_ERR(filp);
goto restore_fs;
}