Commit 54f7bf72 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by David S. Miller

net: netsec: use dma_addr_t for storing dma address

On targets that have different sizes for phys_addr_t and dma_addr_t,
we get a type mismatch error:

drivers/net/ethernet/socionext/netsec.c: In function 'netsec_alloc_dring':
drivers/net/ethernet/socionext/netsec.c:970:9: error: passing argument 3 of 'dma_zalloc_coherent' from incompatible pointer type [-Werror=incompatible-pointer-types]

The code is otherwise correct, as the address is never actually used as a
physical address but only passed into a DMA register.  For consistently,
I'm changing the variable name as well, to clarify that this is a DMA
address.
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Acked-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6bd39bc3
...@@ -252,7 +252,7 @@ struct netsec_desc { ...@@ -252,7 +252,7 @@ struct netsec_desc {
}; };
struct netsec_desc_ring { struct netsec_desc_ring {
phys_addr_t desc_phys; dma_addr_t desc_dma;
struct netsec_desc *desc; struct netsec_desc *desc;
void *vaddr; void *vaddr;
u16 pkt_cnt; u16 pkt_cnt;
...@@ -953,7 +953,7 @@ static void netsec_free_dring(struct netsec_priv *priv, int id) ...@@ -953,7 +953,7 @@ static void netsec_free_dring(struct netsec_priv *priv, int id)
if (dring->vaddr) { if (dring->vaddr) {
dma_free_coherent(priv->dev, DESC_SZ * DESC_NUM, dma_free_coherent(priv->dev, DESC_SZ * DESC_NUM,
dring->vaddr, dring->desc_phys); dring->vaddr, dring->desc_dma);
dring->vaddr = NULL; dring->vaddr = NULL;
} }
...@@ -967,7 +967,7 @@ static int netsec_alloc_dring(struct netsec_priv *priv, enum ring_id id) ...@@ -967,7 +967,7 @@ static int netsec_alloc_dring(struct netsec_priv *priv, enum ring_id id)
int ret = 0; int ret = 0;
dring->vaddr = dma_zalloc_coherent(priv->dev, DESC_SZ * DESC_NUM, dring->vaddr = dma_zalloc_coherent(priv->dev, DESC_SZ * DESC_NUM,
&dring->desc_phys, GFP_KERNEL); &dring->desc_dma, GFP_KERNEL);
if (!dring->vaddr) { if (!dring->vaddr) {
ret = -ENOMEM; ret = -ENOMEM;
goto err; goto err;
...@@ -1087,14 +1087,14 @@ static int netsec_reset_hardware(struct netsec_priv *priv) ...@@ -1087,14 +1087,14 @@ static int netsec_reset_hardware(struct netsec_priv *priv)
/* set desc_start addr */ /* set desc_start addr */
netsec_write(priv, NETSEC_REG_NRM_RX_DESC_START_UP, netsec_write(priv, NETSEC_REG_NRM_RX_DESC_START_UP,
upper_32_bits(priv->desc_ring[NETSEC_RING_RX].desc_phys)); upper_32_bits(priv->desc_ring[NETSEC_RING_RX].desc_dma));
netsec_write(priv, NETSEC_REG_NRM_RX_DESC_START_LW, netsec_write(priv, NETSEC_REG_NRM_RX_DESC_START_LW,
lower_32_bits(priv->desc_ring[NETSEC_RING_RX].desc_phys)); lower_32_bits(priv->desc_ring[NETSEC_RING_RX].desc_dma));
netsec_write(priv, NETSEC_REG_NRM_TX_DESC_START_UP, netsec_write(priv, NETSEC_REG_NRM_TX_DESC_START_UP,
upper_32_bits(priv->desc_ring[NETSEC_RING_TX].desc_phys)); upper_32_bits(priv->desc_ring[NETSEC_RING_TX].desc_dma));
netsec_write(priv, NETSEC_REG_NRM_TX_DESC_START_LW, netsec_write(priv, NETSEC_REG_NRM_TX_DESC_START_LW,
lower_32_bits(priv->desc_ring[NETSEC_RING_TX].desc_phys)); lower_32_bits(priv->desc_ring[NETSEC_RING_TX].desc_dma));
/* set normal tx dring ring config */ /* set normal tx dring ring config */
netsec_write(priv, NETSEC_REG_NRM_TX_CONFIG, netsec_write(priv, NETSEC_REG_NRM_TX_CONFIG,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment