]> git.baikalelectronics.ru Git - kernel.git/commit
net: sh_eth: use correct "struct device" when calling DMA mapping functions
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Mon, 4 Dec 2017 13:33:26 +0000 (14:33 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 5 Dec 2017 19:40:34 +0000 (14:40 -0500)
commitd777306189f2013557181ce36d93f2001e3534af
treead4da0706a645811b43cbaef960b1db052661607
parent6a0be9a038e64b99c659b486b1696d2e3595fd2b
net: sh_eth: use correct "struct device" when calling DMA mapping functions

There are two types of "struct device": the one representing the
physical device on its physical bus (platform, SPI, PCI, etc.), and
the one representing the logical device in its device class (net,
etc.).

The DMA mapping API expects to receive as argument a "struct device"
representing the physical device, as the "struct device" contains
information about the bus that the DMA API needs.

However, the sh_eth driver mistakenly uses the "struct device"
representing the logical device (embedded in "struct net_device")
rather than the "struct device" representing the physical device on
its bus.

This commit fixes that by adjusting all calls to the DMA mapping API.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/renesas/sh_eth.c