Skip to content

Commit

Permalink
fm10k: prefer %s and __func__ for diagnostic prints
Browse files Browse the repository at this point in the history
Don't hard code the function names in the diagnostic output when these
reset related routines fail. Instead, use %s and __func__ so that future
refactors don't need to change the print outs.

Additionally, while we are here, add missing function header comments
for the new reset_prepare and reset_done function handlers.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Krishneil Singh <krishneil.k.singh@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
  • Loading branch information
Jacob Keller authored and Jeff Kirsher committed Oct 3, 2017
1 parent c0ad8ef commit 87be989
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions drivers/net/ethernet/intel/fm10k/fm10k_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -2588,11 +2588,18 @@ static void fm10k_io_resume(struct pci_dev *pdev)

if (err)
dev_warn(&pdev->dev,
"fm10k_io_resume failed: %d\n", err);
"%s failed: %d\n", __func__, err);
else
netif_device_attach(netdev);
}

/**
* fm10k_io_reset_prepare - called when PCI function is about to be reset
* @pdev: Pointer to PCI device
*
* This callback is called when the PCI function is about to be reset,
* allowing the device driver to prepare for it.
*/
static void fm10k_io_reset_prepare(struct pci_dev *pdev)
{
/* warn incase we have any active VF devices */
Expand All @@ -2602,14 +2609,21 @@ static void fm10k_io_reset_prepare(struct pci_dev *pdev)
fm10k_prepare_suspend(pci_get_drvdata(pdev));
}

/**
* fm10k_io_reset_done - called when PCI function has finished resetting
* @pdev: Pointer to PCI device
*
* This callback is called just after the PCI function is reset, such as via
* /sys/class/net/<enpX>/device/reset or similar.
*/
static void fm10k_io_reset_done(struct pci_dev *pdev)
{
struct fm10k_intfc *interface = pci_get_drvdata(pdev);
int err = fm10k_handle_resume(interface);

if (err) {
dev_warn(&pdev->dev,
"fm10k_io_reset_notify failed: %d\n", err);
"%s failed: %d\n", __func__, err);
netif_device_detach(interface->netdev);
}
}
Expand Down

0 comments on commit 87be989

Please sign in to comment.