summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/pensando
diff options
context:
space:
mode:
authorShannon Nelson <snelson@pensando.io>2020-03-17 06:22:06 +0300
committerDavid S. Miller <davem@davemloft.net>2020-03-18 07:18:25 +0300
commitecd2d8b0fb18d9b8e31ca577258e0282cb63fc91 (patch)
tree674ccae9c69f4c9007f661a00cb55dbbadd03073 /drivers/net/ethernet/pensando
parentc7cba8326c1eba1f49f39a71cd9ef03a03a80da4 (diff)
downloadlinux-ecd2d8b0fb18d9b8e31ca577258e0282cb63fc91.tar.xz
ionic: stop devlink warn on mgmt device
If we don't set a port type, the devlink code will eventually print a WARN in the kernel log. Because the mgmt device is not really a useful port, don't register it as a devlink port. Fixes: b3f064e9746d ("ionic: add support for device id 0x1004") Signed-off-by: Shannon Nelson <snelson@pensando.io> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/pensando')
-rw-r--r--drivers/net/ethernet/pensando/ionic/ionic_devlink.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/net/ethernet/pensando/ionic/ionic_devlink.c b/drivers/net/ethernet/pensando/ionic/ionic_devlink.c
index ed14164468a1..273c889faaad 100644
--- a/drivers/net/ethernet/pensando/ionic/ionic_devlink.c
+++ b/drivers/net/ethernet/pensando/ionic/ionic_devlink.c
@@ -77,12 +77,16 @@ int ionic_devlink_register(struct ionic *ionic)
return err;
}
+ /* don't register the mgmt_nic as a port */
+ if (ionic->is_mgmt_nic)
+ return 0;
+
devlink_port_attrs_set(&ionic->dl_port, DEVLINK_PORT_FLAVOUR_PHYSICAL,
0, false, 0, NULL, 0);
err = devlink_port_register(dl, &ionic->dl_port, 0);
if (err)
dev_err(ionic->dev, "devlink_port_register failed: %d\n", err);
- else if (!ionic->is_mgmt_nic)
+ else
devlink_port_type_eth_set(&ionic->dl_port,
ionic->master_lif->netdev);
@@ -93,6 +97,7 @@ void ionic_devlink_unregister(struct ionic *ionic)
{
struct devlink *dl = priv_to_devlink(ionic);
- devlink_port_unregister(&ionic->dl_port);
+ if (ionic->dl_port.registered)
+ devlink_port_unregister(&ionic->dl_port);
devlink_unregister(dl);
}