[PATCH] remove vio_dma_mapping_error

Stephen Rothwell sfr at canb.auug.org.au
Thu Apr 8 14:51:08 EST 2004


Hi Anton,

James Bottomley is right, this was a mistake.  This patch replaces
vio_dma_mapping_error with dma_mapping_error everywhere.

--
Cheers,
Stephen Rothwell                    sfr at canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
-------------- next part --------------
diff -ruN ppc64-2.5-iseries.vio.1/drivers/net/ibmveth.c ppc64-2.5-iseries.vio.1.dma.5/drivers/net/ibmveth.c
--- ppc64-2.5-iseries.vio.1/drivers/net/ibmveth.c	2004-04-04 17:04:43.000000000 +1000
+++ ppc64-2.5-iseries.vio.1.dma.5/drivers/net/ibmveth.c	2004-04-08 14:23:17.000000000 +1000
@@ -405,7 +405,7 @@
 static void ibmveth_cleanup(struct ibmveth_adapter *adapter)
 {
 	if(adapter->buffer_list_addr != NULL) {
-		if(!vio_dma_mapping_error(adapter->buffer_list_dma)) {
+		if(!dma_mapping_error(adapter->buffer_list_dma)) {
 			vio_unmap_single(adapter->vdev, adapter->buffer_list_dma, 4096, PCI_DMA_BIDIRECTIONAL);
 			adapter->buffer_list_dma = DMA_ERROR_CODE;
 		}
@@ -414,7 +414,7 @@
 	}

 	if(adapter->filter_list_addr != NULL) {
-		if(!vio_dma_mapping_error(adapter->filter_list_dma)) {
+		if(!dma_mapping_error(adapter->filter_list_dma)) {
 			vio_unmap_single(adapter->vdev, adapter->filter_list_dma, 4096, PCI_DMA_BIDIRECTIONAL);
 			adapter->filter_list_dma = DMA_ERROR_CODE;
 		}
@@ -423,7 +423,7 @@
 	}

 	if(adapter->rx_queue.queue_addr != NULL) {
-		if(!vio_dma_mapping_error(adapter->rx_queue.queue_dma)) {
+		if(!dma_mapping_error(adapter->rx_queue.queue_dma)) {
 			vio_unmap_single(adapter->vdev, adapter->rx_queue.queue_dma, adapter->rx_queue.queue_len, PCI_DMA_BIDIRECTIONAL);
 			adapter->rx_queue.queue_dma = DMA_ERROR_CODE;
 		}
@@ -474,9 +474,9 @@
 	adapter->filter_list_dma = vio_map_single(adapter->vdev, adapter->filter_list_addr, 4096, PCI_DMA_BIDIRECTIONAL);
 	adapter->rx_queue.queue_dma = vio_map_single(adapter->vdev, adapter->rx_queue.queue_addr, adapter->rx_queue.queue_len, PCI_DMA_BIDIRECTIONAL);

-	if((vio_dma_mapping_error(adapter->buffer_list_dma) ) ||
-	   (vio_dma_mapping_error(adapter->filter_list_dma)) ||
-	   (vio_dma_mapping_error(adapter->rx_queue.queue_dma))) {
+	if((dma_mapping_error(adapter->buffer_list_dma) ) ||
+	   (dma_mapping_error(adapter->filter_list_dma)) ||
+	   (dma_mapping_error(adapter->rx_queue.queue_dma))) {
 		ibmveth_error_printk("unable to map filter or buffer list pages\n");
 		ibmveth_cleanup(adapter);
 		return -ENOMEM;
@@ -645,7 +645,7 @@
 	desc[0].fields.address = vio_map_single(adapter->vdev, skb->data, desc[0].fields.length, PCI_DMA_TODEVICE);
 	desc[0].fields.valid   = 1;

-	if(vio_dma_mapping_error(desc[0].fields.address)) {
+	if(dma_mapping_error(desc[0].fields.address)) {
 		ibmveth_error_printk("tx: unable to map initial fragment\n");
 		adapter->tx_map_failed++;
 		adapter->stats.tx_dropped++;
@@ -664,7 +664,7 @@
 		desc[curfrag+1].fields.length = frag->size;
 		desc[curfrag+1].fields.valid  = 1;

-		if(vio_dma_mapping_error(desc[curfrag+1].fields.address)) {
+		if(dma_mapping_error(desc[curfrag+1].fields.address)) {
 			ibmveth_error_printk("tx: unable to map fragment %d\n", curfrag);
 			adapter->tx_map_failed++;
 			adapter->stats.tx_dropped++;
diff -ruN ppc64-2.5-iseries.vio.1/drivers/net/iseries_veth.c ppc64-2.5-iseries.vio.1.dma.5/drivers/net/iseries_veth.c
--- ppc64-2.5-iseries.vio.1/drivers/net/iseries_veth.c	2004-04-02 14:32:02.000000000 +1000
+++ ppc64-2.5-iseries.vio.1.dma.5/drivers/net/iseries_veth.c	2004-04-08 14:22:38.000000000 +1000
@@ -905,7 +905,7 @@

 	/* Is it really necessary to check the length and address
 	 * fields of the first entry here? */
-	if (!vio_dma_mapping_error(dma_address)) {
+	if (!dma_mapping_error(dma_address)) {
 		msg->skb = skb;
 		msg->data.addr[0] = dma_address;
 		msg->data.len[0] = dma_length;
diff -ruN ppc64-2.5-iseries.vio.1/drivers/scsi/ibmvscsi/ibmvscsis.c ppc64-2.5-iseries.vio.1.dma.5/drivers/scsi/ibmvscsi/ibmvscsis.c
--- ppc64-2.5-iseries.vio.1/drivers/scsi/ibmvscsi/ibmvscsis.c	2004-04-02 13:52:26.000000000 +1000
+++ ppc64-2.5-iseries.vio.1.dma.5/drivers/scsi/ibmvscsi/ibmvscsis.c	2004-04-08 14:23:31.000000000 +1000
@@ -1862,7 +1862,7 @@
 					  queue->size * sizeof(*queue->msgs),
 					  DMA_BIDIRECTIONAL);

-	if (vio_dma_mapping_error(queue->msg_token))
+	if (dma_mapping_error(queue->msg_token))
 		goto map_failed;

 	rc = plpar_hcall_norets(H_REG_CRQ, adapter->dma_dev->unit_address, queue->msg_token, PAGE_SIZE);
diff -ruN ppc64-2.5-iseries.vio.1/include/asm-ppc64/vio.h ppc64-2.5-iseries.vio.1.dma.5/include/asm-ppc64/vio.h
--- ppc64-2.5-iseries.vio.1/include/asm-ppc64/vio.h	2004-04-02 13:52:26.000000000 +1000
+++ ppc64-2.5-iseries.vio.1.dma.5/include/asm-ppc64/vio.h	2004-04-08 14:26:43.000000000 +1000
@@ -137,9 +137,4 @@
 	return container_of(dev, struct vio_dev, dev);
 }

-static inline int vio_dma_mapping_error(dma_addr_t dma_addr)
-{
-	return dma_mapping_error(dma_addr);
-}
-
 #endif /* _ASM_VIO_H */


More information about the Linuxppc64-dev mailing list