This patch adds rx_alloc helper function for GbEthernet found on RZ/G2L SoC. Signed-off-by: Biju Das <biju.das.jz@xxxxxxxxxxxxxx> --- drivers/net/ethernet/renesas/ravb_main.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c index ee1066fedc4a..a08da7a37b92 100644 --- a/drivers/net/ethernet/renesas/ravb_main.c +++ b/drivers/net/ethernet/renesas/ravb_main.c @@ -430,8 +430,15 @@ static void ravb_ring_format(struct net_device *ndev, int q) static void *ravb_rgeth_alloc_rx_desc(struct net_device *ndev, int q) { - /* Place holder */ - return NULL; + struct ravb_private *priv = netdev_priv(ndev); + unsigned int ring_size; + + ring_size = sizeof(struct ravb_rx_desc) * (priv->num_rx_ring[q] + 1); + + priv->rgeth_rx_ring[q] = dma_alloc_coherent(ndev->dev.parent, ring_size, + &priv->rx_desc_dma[q], + GFP_KERNEL); + return priv->rgeth_rx_ring[q]; } static void *ravb_alloc_rx_desc(struct net_device *ndev, int q) -- 2.17.1