[malloc] Rename malloc_dma() to malloc_phys()
The malloc_dma() function allocates memory with specified physical alignment, and is typically (though not exclusively) used to allocate memory for DMA. Rename to malloc_phys() to more closely match the functionality, and to create name space for functions that specifically allocate and map DMA-capable buffers. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -552,7 +552,7 @@ static int sis190_open(struct net_device *dev)
|
||||
int rc;
|
||||
|
||||
/* Allocate TX ring */
|
||||
tp->TxDescRing = malloc_dma(TX_RING_BYTES, RING_ALIGNMENT);
|
||||
tp->TxDescRing = malloc_phys(TX_RING_BYTES, RING_ALIGNMENT);
|
||||
if (!tp->TxDescRing) {
|
||||
DBG("sis190: TX ring allocation failed\n");
|
||||
rc = -ENOMEM;
|
||||
@@ -561,7 +561,7 @@ static int sis190_open(struct net_device *dev)
|
||||
tp->tx_dma = cpu_to_le32(virt_to_bus(tp->TxDescRing));
|
||||
|
||||
/* Allocate RX ring */
|
||||
tp->RxDescRing = malloc_dma(RX_RING_BYTES, RING_ALIGNMENT);
|
||||
tp->RxDescRing = malloc_phys(RX_RING_BYTES, RING_ALIGNMENT);
|
||||
if (!tp->RxDescRing) {
|
||||
DBG("sis190: RX ring allocation failed\n");
|
||||
rc = -ENOMEM;
|
||||
@@ -600,8 +600,8 @@ static void sis190_free(struct net_device *dev)
|
||||
struct sis190_private *tp = netdev_priv(dev);
|
||||
int i;
|
||||
|
||||
free_dma(tp->TxDescRing, TX_RING_BYTES);
|
||||
free_dma(tp->RxDescRing, RX_RING_BYTES);
|
||||
free_phys(tp->TxDescRing, TX_RING_BYTES);
|
||||
free_phys(tp->RxDescRing, RX_RING_BYTES);
|
||||
|
||||
tp->TxDescRing = NULL;
|
||||
tp->RxDescRing = NULL;
|
||||
|
||||
Reference in New Issue
Block a user