aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/aquantia/atlantic/aq_nic.c
diff options
context:
space:
mode:
authorIgor Russkikh <igor.russkikh@aquantia.com>2018-01-15 16:41:18 +0300
committerDavid S. Miller <davem@davemloft.net>2018-01-16 14:40:00 -0500
commit5b97b0d10eddeeec258b807f009a2cb2764653c7 (patch)
tree5d03c0038f540027814a55ef332bd97445e238a4 /drivers/net/ethernet/aquantia/atlantic/aq_nic.c
parentnet: aquantia: Add const qualifiers for hardware ops tables (diff)
downloadlinux-dev-5b97b0d10eddeeec258b807f009a2cb2764653c7.tar.xz
linux-dev-5b97b0d10eddeeec258b807f009a2cb2764653c7.zip
net: aquantia: Simplify dependencies between pci modules
Eliminate useless passing of net_device_ops and ethtools_ops through deep chain of calls. Move all pci related code into aq_pci_func module. Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/aquantia/atlantic/aq_nic.c')
-rw-r--r--drivers/net/ethernet/aquantia/atlantic/aq_nic.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_nic.c b/drivers/net/ethernet/aquantia/atlantic/aq_nic.c
index f210e6237679..00b0ad92540a 100644
--- a/drivers/net/ethernet/aquantia/atlantic/aq_nic.c
+++ b/drivers/net/ethernet/aquantia/atlantic/aq_nic.c
@@ -15,6 +15,7 @@
#include "aq_hw.h"
#include "aq_pci_func.h"
#include "aq_nic_internal.h"
+#include "aq_main.h"
#include <linux/moduleparam.h>
#include <linux/netdevice.h>
@@ -205,14 +206,7 @@ static void aq_nic_polling_timer_cb(struct timer_list *t)
AQ_CFG_POLLING_TIMER_INTERVAL);
}
-static struct net_device *aq_nic_ndev_alloc(void)
-{
- return alloc_etherdev_mq(sizeof(struct aq_nic_s), AQ_CFG_VECS_MAX);
-}
-
-struct aq_nic_s *aq_nic_alloc_cold(const struct net_device_ops *ndev_ops,
- const struct ethtool_ops *et_ops,
- struct pci_dev *pdev,
+struct aq_nic_s *aq_nic_alloc_cold(struct pci_dev *pdev,
struct aq_pci_func_s *aq_pci_func,
unsigned int port,
const struct aq_hw_ops *aq_hw_ops)
@@ -221,7 +215,7 @@ struct aq_nic_s *aq_nic_alloc_cold(const struct net_device_ops *ndev_ops,
struct aq_nic_s *self = NULL;
int err = 0;
- ndev = aq_nic_ndev_alloc();
+ ndev = aq_ndev_alloc();
if (!ndev) {
err = -ENOMEM;
goto err_exit;
@@ -229,9 +223,6 @@ struct aq_nic_s *aq_nic_alloc_cold(const struct net_device_ops *ndev_ops,
self = netdev_priv(ndev);
- ndev->netdev_ops = ndev_ops;
- ndev->ethtool_ops = et_ops;
-
SET_NETDEV_DEV(ndev, &pdev->dev);
ndev->if_port = port;