};
ATTRIBUTE_GROUPS(bnxt);
-static void bnxt_hwmon_close(struct bnxt *bp)
+static void bnxt_hwmon_uninit(struct bnxt *bp)
{
if (bp->hwmon_dev) {
hwmon_device_unregister(bp->hwmon_dev);
}
}
-static void bnxt_hwmon_open(struct bnxt *bp)
+static void bnxt_hwmon_init(struct bnxt *bp)
{
struct hwrm_temp_monitor_query_input *req;
struct pci_dev *pdev = bp->pdev;
if (!rc)
rc = hwrm_req_send_silent(bp, req);
if (rc == -EACCES || rc == -EOPNOTSUPP) {
- bnxt_hwmon_close(bp);
+ bnxt_hwmon_uninit(bp);
return;
}
}
}
#else
-static void bnxt_hwmon_close(struct bnxt *bp)
+static void bnxt_hwmon_uninit(struct bnxt *bp)
{
}
-static void bnxt_hwmon_open(struct bnxt *bp)
+static void bnxt_hwmon_init(struct bnxt *bp)
{
}
#endif
bnxt_reenable_sriov(bp);
}
}
- bnxt_hwmon_open(bp);
}
return rc;
{
struct bnxt *bp = netdev_priv(dev);
- bnxt_hwmon_close(bp);
bnxt_close_nic(bp, true, true);
bnxt_hwrm_shutdown_link(bp);
bnxt_hwrm_if_change(bp, false);
if (bp->fw_cap & BNXT_FW_CAP_PTP)
__bnxt_hwrm_ptp_qcfg(bp);
bnxt_dcb_init(bp);
+ bnxt_hwmon_init(bp);
return 0;
}
bnxt_clear_int_mode(bp);
bnxt_hwrm_func_drv_unrgtr(bp);
bnxt_free_hwrm_resources(bp);
+ bnxt_hwmon_uninit(bp);
bnxt_ethtool_free(bp);
bnxt_dcb_free(bp);
kfree(bp->ptp_cfg);
init_err_pci_clean:
bnxt_hwrm_func_drv_unrgtr(bp);
bnxt_free_hwrm_resources(bp);
+ bnxt_hwmon_uninit(bp);
bnxt_ethtool_free(bp);
bnxt_ptp_clear(bp);
kfree(bp->ptp_cfg);