staging: ft1000: Fix coding style in init_ft1000_netdev function.
Signed-off-by: Marek Belisko <marek.belisko@open-nandra.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
cb3aa5d5b5
commit
6c284c7b06
1 changed files with 55 additions and 67 deletions
|
@ -722,18 +722,14 @@ u16 init_ft1000_netdev(struct ft1000_device *ft1000dev)
|
|||
|
||||
DEBUG("Enter init_ft1000_netdev...\n");
|
||||
|
||||
|
||||
netdev = alloc_etherdev(sizeof(struct ft1000_info));
|
||||
if (!netdev )
|
||||
{
|
||||
if (!netdev) {
|
||||
DEBUG("init_ft1000_netdev: can not allocate network device\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
pInfo = netdev_priv(netdev);
|
||||
|
||||
//DEBUG("init_ft1000_netdev: gFt1000Info=%x, netdev=%x, ft1000dev=%x\n", gFt1000Info, netdev, ft1000dev);
|
||||
|
||||
memset(pInfo, 0, sizeof(struct ft1000_info));
|
||||
|
||||
dev_alloc_name(netdev, netdev->name);
|
||||
|
@ -751,8 +747,7 @@ u16 init_ft1000_netdev(struct ft1000_device *ft1000dev)
|
|||
|
||||
pInfo->CardNumber = gCardIndex;
|
||||
DEBUG("card number = %d\n", pInfo->CardNumber);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
printk(KERN_ERR "ft1000: Invalid device name\n");
|
||||
ret_val = -ENXIO;
|
||||
goto err_net;
|
||||
|
@ -785,7 +780,7 @@ u16 init_ft1000_netdev(struct ft1000_device *ft1000dev)
|
|||
INIT_LIST_HEAD(&pInfo->prov_list);
|
||||
|
||||
INIT_LIST_HEAD(&pInfo->nodes.list);
|
||||
//mbelian
|
||||
|
||||
#ifdef HAVE_NET_DEVICE_OPS
|
||||
netdev->netdev_ops = &ftnet_ops;
|
||||
#else
|
||||
|
@ -797,41 +792,36 @@ u16 init_ft1000_netdev(struct ft1000_device *ft1000dev)
|
|||
|
||||
ft1000dev->net = netdev;
|
||||
|
||||
|
||||
|
||||
//init free_buff_lock, freercvpool, numofmsgbuf, pdpram_blk
|
||||
//only init once per card
|
||||
//Jim
|
||||
DEBUG("Initialize free_buff_lock and freercvpool\n");
|
||||
spin_lock_init(&free_buff_lock);
|
||||
|
||||
// initialize a list of buffers to be use for queuing up receive command data
|
||||
/* initialize a list of buffers to be use for queuing
|
||||
* up receive command data
|
||||
*/
|
||||
INIT_LIST_HEAD(&freercvpool);
|
||||
|
||||
// create list of free buffers
|
||||
/* create list of free buffers */
|
||||
for (i = 0; i < NUM_OF_FREE_BUFFERS; i++) {
|
||||
// Get memory for DPRAM_DATA link list
|
||||
/* Get memory for DPRAM_DATA link list */
|
||||
pdpram_blk = kmalloc(sizeof(struct dpram_blk), GFP_KERNEL);
|
||||
if (pdpram_blk == NULL) {
|
||||
ret_val = -ENOMEM;
|
||||
goto err_free;
|
||||
}
|
||||
// Get a block of memory to store command data
|
||||
/* Get a block of memory to store command data */
|
||||
pdpram_blk->pbuffer = kmalloc(MAX_CMD_SQSIZE, GFP_KERNEL);
|
||||
if (pdpram_blk->pbuffer == NULL) {
|
||||
ret_val = -ENOMEM;
|
||||
kfree(pdpram_blk);
|
||||
goto err_free;
|
||||
}
|
||||
// link provisioning data
|
||||
/* link provisioning data */
|
||||
list_add_tail(&pdpram_blk->list, &freercvpool);
|
||||
}
|
||||
numofmsgbuf = NUM_OF_FREE_BUFFERS;
|
||||
|
||||
|
||||
return 0;
|
||||
|
||||
|
||||
err_free:
|
||||
list_for_each_safe(cur, tmp, &freercvpool) {
|
||||
pdpram_blk = list_entry(cur, struct dpram_blk, list);
|
||||
|
@ -844,8 +834,6 @@ err_net:
|
|||
return ret_val;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Function: reg_ft1000_netdev
|
||||
//
|
||||
|
|
Reference in a new issue