chelsio: cxgb: Use dma_set_mask_and_coherent() and simplify code
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sat, 1 Jan 2022 21:15:29 +0000 (22:15 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sun, 2 Jan 2022 16:14:30 +0000 (16:14 +0000)
commit1aae5cc0a55c097f16ccce1493415c63d60babc9
treeb8ce7a49375547451bca1e5032882db3714634e4
parent584c61cedb12f983e97a01762457b75dfdef626b
chelsio: cxgb: 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, 'pci_using_dac' can only be 1 after a successful
dma_set_mask_and_coherent().

Simplify code and remove some dead code accordingly.

[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/chelsio/cxgb/cxgb2.c