aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/qualcomm/emac/emac-mac.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet/qualcomm/emac/emac-mac.c')
-rw-r--r--drivers/net/ethernet/qualcomm/emac/emac-mac.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/net/ethernet/qualcomm/emac/emac-mac.c b/drivers/net/ethernet/qualcomm/emac/emac-mac.c
index d5a32b7c7dc5..031f6e6ee9c1 100644
--- a/drivers/net/ethernet/qualcomm/emac/emac-mac.c
+++ b/drivers/net/ethernet/qualcomm/emac/emac-mac.c
@@ -683,10 +683,11 @@ static int emac_tx_q_desc_alloc(struct emac_adapter *adpt,
683 struct emac_tx_queue *tx_q) 683 struct emac_tx_queue *tx_q)
684{ 684{
685 struct emac_ring_header *ring_header = &adpt->ring_header; 685 struct emac_ring_header *ring_header = &adpt->ring_header;
686 int node = dev_to_node(adpt->netdev->dev.parent);
686 size_t size; 687 size_t size;
687 688
688 size = sizeof(struct emac_buffer) * tx_q->tpd.count; 689 size = sizeof(struct emac_buffer) * tx_q->tpd.count;
689 tx_q->tpd.tpbuff = kzalloc(size, GFP_KERNEL); 690 tx_q->tpd.tpbuff = kzalloc_node(size, GFP_KERNEL, node);
690 if (!tx_q->tpd.tpbuff) 691 if (!tx_q->tpd.tpbuff)
691 return -ENOMEM; 692 return -ENOMEM;
692 693
@@ -723,11 +724,12 @@ static void emac_rx_q_bufs_free(struct emac_adapter *adpt)
723static int emac_rx_descs_alloc(struct emac_adapter *adpt) 724static int emac_rx_descs_alloc(struct emac_adapter *adpt)
724{ 725{
725 struct emac_ring_header *ring_header = &adpt->ring_header; 726 struct emac_ring_header *ring_header = &adpt->ring_header;
727 int node = dev_to_node(adpt->netdev->dev.parent);
726 struct emac_rx_queue *rx_q = &adpt->rx_q; 728 struct emac_rx_queue *rx_q = &adpt->rx_q;
727 size_t size; 729 size_t size;
728 730
729 size = sizeof(struct emac_buffer) * rx_q->rfd.count; 731 size = sizeof(struct emac_buffer) * rx_q->rfd.count;
730 rx_q->rfd.rfbuff = kzalloc(size, GFP_KERNEL); 732 rx_q->rfd.rfbuff = kzalloc_node(size, GFP_KERNEL, node);
731 if (!rx_q->rfd.rfbuff) 733 if (!rx_q->rfd.rfbuff)
732 return -ENOMEM; 734 return -ENOMEM;
733 735
@@ -920,14 +922,13 @@ static void emac_mac_rx_descs_refill(struct emac_adapter *adpt,
920static void emac_adjust_link(struct net_device *netdev) 922static void emac_adjust_link(struct net_device *netdev)
921{ 923{
922 struct emac_adapter *adpt = netdev_priv(netdev); 924 struct emac_adapter *adpt = netdev_priv(netdev);
923 struct emac_sgmii *sgmii = &adpt->phy;
924 struct phy_device *phydev = netdev->phydev; 925 struct phy_device *phydev = netdev->phydev;
925 926
926 if (phydev->link) { 927 if (phydev->link) {
927 emac_mac_start(adpt); 928 emac_mac_start(adpt);
928 sgmii->link_up(adpt); 929 emac_sgmii_link_change(adpt, true);
929 } else { 930 } else {
930 sgmii->link_down(adpt); 931 emac_sgmii_link_change(adpt, false);
931 emac_mac_stop(adpt); 932 emac_mac_stop(adpt);
932 } 933 }
933 934