OSDN Git Service

net: vxge: Use dma_set_mask_and_coherent() and simplify code
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sun, 2 Jan 2022 21:07:05 +0000 (22:07 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 3 Jan 2022 10:42:58 +0000 (10:42 +0000)
commit3d694552fd8fe502e7ffd22ffa0e085bfd73b19a
treedddd007af102d87b3803e30aebd76488fe01576d
parent7120075ec41aed3bf377df7924d213f1c43f7462
net: vxge: Use dma_set_mask_and_coherent() and simplify code

Use dma_set_mask_and_coherent() instead of unrolling it with some
dma_set_mask()+dma_set_coherent_mask().

Moreover, as stated in [1], dma_set_mask() with a 64-bit mask will never
fail if dev->dma_mask is non-NULL.
So, if it fails, the 32 bits case will also fail for the same reason.

That said, 'high_dma' can only be 1 after a successful
dma_set_mask_and_coherent().

Simplify code and remove some dead code accordingly, including a now
useless parameter to vxge_device_register().

[1]: https://lkml.org/lkml/2021/6/7/398

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/neterion/vxge/vxge-main.c