net: hisilicon: Fix dma_map_single failed on arm64
authorJiangfeng Xiao <xiaojiangfeng@huawei.com>
Sat, 3 Aug 2019 12:31:41 +0000 (20:31 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 Aug 2019 06:26:40 +0000 (08:26 +0200)
commit9e47a7963485c636a0e75b192c898d72d16bac38
treea24e74355016bc565beb552df2dfe92e68dc0b2c
parent414938c46365c6e4cde9049fdf17a56801be8bdb
net: hisilicon: Fix dma_map_single failed on arm64

[ Upstream commit 96a50c0d907ac8f5c3d6b051031a19eb8a2b53e3 ]

On the arm64 platform, executing "ifconfig eth0 up" will fail,
returning "ifconfig: SIOCSIFFLAGS: Input/output error."

ndev->dev is not initialized, dma_map_single->get_dma_ops->
dummy_dma_ops->__dummy_map_page will return DMA_ERROR_CODE
directly, so when we use dma_map_single, the first parameter
is to use the device of platform_device.

Signed-off-by: Jiangfeng Xiao <xiaojiangfeng@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/hisilicon/hip04_eth.c