[PATCH 4/5] net: fec_imx: Return EFAULT when DMA mapping fails

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



EFAULT seems to be much more appropriate error code for DMA mapping
failure, it also produces more informative message, compare:

ping 192.168.53.7
WARNING: eth0: No MAC address set. Using random address 92:4e:f1:18:96:67
eth0: 100Mbps full duplex link detected
ping failed: Bad address

versus old message:

ping 192.168.53.7
WARNING: eth0: No MAC address set. Using random address c6:b7:67:bb:4a:c3
eth0: 100Mbps full duplex link detected
ping failed: I/O error

Signed-off-by: Andrey Smirnov <andrew.smirnov@xxxxxxxxx>
---
 drivers/net/fec_imx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/fec_imx.c b/drivers/net/fec_imx.c
index f459516df..33262bdfa 100644
--- a/drivers/net/fec_imx.c
+++ b/drivers/net/fec_imx.c
@@ -466,7 +466,7 @@ static int fec_send(struct eth_device *dev, void *eth_data, int data_length)
 
 	dma = dma_map_single(fec->dev, eth_data, data_length, DMA_TO_DEVICE);
 	if (dma_mapping_error(fec->dev, dma))
-		return -EIO;
+		return -EFAULT;
 
 	writel((uint32_t)(dma), &fec->tbd_base[fec->tbd_index].data_pointer);
 
-- 
2.17.1


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux