/* We allocate one ring per queue at run-time since we don't know the number of queues at compile-time.  */
static int __devinit e1000_alloc_queues(struct e1000_adapter *adapter)
/* We allocate one ring per queue at run-time since we don't know the number of queues at compile-time.  */
static int __devinit e1000_alloc_queues(struct e1000_adapter *adapter)
{
	adapter->tx_ring = kcalloc(adapter->num_tx_queues,
	                           sizeof(struct e1000_tx_ring), GFP_KERNEL);
	if (!adapter->tx_ring)
		return -ENOMEM;
	adapter->rx_ring = kcalloc(adapter->num_rx_queues,
	                           sizeof(struct e1000_rx_ring), GFP_KERNEL);
	if (!adapter->rx_ring) {
		kfree(adapter->tx_ring);
		return -ENOMEM;
	}
	return E1000_SUCCESS;
}