Commit 7a8b0055 authored by Andres More's avatar Andres More Committed by Greg Kroah-Hartman
Browse files

staging: vt6656: code cleanup in vt6656_probe()



Lindented, cleared checkpatch warnings and removed legacy comments.

Signed-off-by: default avatarAndres More <more.andres@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 89b28e5d
Loading
Loading
Loading
Loading
+44 −50
Original line number Diff line number Diff line
@@ -757,7 +757,6 @@ static const struct net_device_ops device_netdev_ops = {
    .ndo_set_multicast_list = device_set_multi,
};


static int __devinit
vt6656_probe(struct usb_interface *intf, const struct usb_device_id *id)
{
@@ -767,15 +766,13 @@ vt6656_probe(struct usb_interface *intf, const struct usb_device_id *id)
	struct net_device *netdev = NULL;
	PSDevice pDevice = NULL;


	printk(KERN_NOTICE "%s Ver. %s\n", DEVICE_FULL_DRV_NAM, DEVICE_VERSION);
	printk(KERN_NOTICE "Copyright (c) 2004 VIA Networking Technologies, Inc.\n");

	udev = usb_get_dev(udev);

	netdev = alloc_etherdev(sizeof(DEVICE_INFO));

    if (netdev == NULL) {
	if (!netdev) {
		printk(KERN_ERR DEVICE_NAME ": allocate net device failed\n");
		kfree(pDevice);
		goto err_nomem;
@@ -787,7 +784,6 @@ vt6656_probe(struct usb_interface *intf, const struct usb_device_id *id)
	pDevice->dev = netdev;
	pDevice->usb = udev;

    // Set initial settings
	device_set_options(pDevice);
	spin_lock_init(&pDevice->lock);

@@ -795,16 +791,14 @@ vt6656_probe(struct usb_interface *intf, const struct usb_device_id *id)
	pDevice->sMgmtObj.pAdapter = (void *) pDevice;

	netdev->netdev_ops = &device_netdev_ops;
	netdev->wireless_handlers =
		(struct iw_handler_def *) &iwctl_handler_def;

	netdev->wireless_handlers = (struct iw_handler_def *)&iwctl_handler_def;

   //2008-0623-01<Remark>by MikeLiu
  //2007-0821-01<Add>by MikeLiu
	usb_set_intfdata(intf, pDevice);
	SET_NETDEV_DEV(netdev, &intf->dev);
	memcpy(pDevice->dev->dev_addr, fake_mac, ETH_ALEN);
	rc = register_netdev(netdev);
    if (rc != 0) {
	if (rc) {
		printk(KERN_ERR DEVICE_NAME " Failed to register netdev\n");
		free_netdev(netdev);
		kfree(pDevice);
@@ -818,20 +812,20 @@ vt6656_probe(struct usb_interface *intf, const struct usb_device_id *id)
		memset(&wrqu, 0, sizeof(wrqu));
		wrqu.data.flags = RT_INSMOD_EVENT_FLAG;
		wrqu.data.length = IFNAMSIZ;
  wireless_send_event(pDevice->dev, IWEVCUSTOM, &wrqu, pDevice->dev->name);
		wireless_send_event(pDevice->dev,
				    IWEVCUSTOM,
				    &wrqu,
				    pDevice->dev->name);
	}

	return 0;


err_nomem:
 //2008-0922-01<Add>by MikeLiu, decrease usb counter.
	usb_put_dev(udev);

	return -ENOMEM;
}


static void device_free_tx_bufs(PSDevice pDevice)
{
    PUSB_SEND_CONTEXT pTxContext;