bnxt_en: Call devlink_port_type_clear() in remove()
authorVasundhara Volam <vasundhara-v.volam@broadcom.com>
Sun, 8 Mar 2020 22:45:54 +0000 (18:45 -0400)
committerDavid S. Miller <davem@davemloft.net>
Mon, 9 Mar 2020 04:54:46 +0000 (21:54 -0700)
Similar to other drivers, properly clear the devlink port type when
removing the device before unregistration.

Cc: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnxt/bnxt.c

index 02ac718..4c9696a 100644 (file)
@@ -11429,6 +11429,8 @@ static void bnxt_remove_one(struct pci_dev *pdev)
                bnxt_sriov_disable(bp);
 
        bnxt_dl_fw_reporters_destroy(bp, true);
+       if (BNXT_PF(bp))
+               devlink_port_type_clear(&bp->dl_port);
        pci_disable_pcie_error_reporting(pdev);
        unregister_netdev(dev);
        bnxt_dl_unregister(bp);