Commit 87be9892 authored by Jacob Keller's avatar Jacob Keller Committed by Jeff Kirsher

fm10k: prefer %s and __func__ for diagnostic prints

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: default avatarJacob Keller <jacob.e.keller@intel.com>
Tested-by: default avatarKrishneil Singh <krishneil.k.singh@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent c0ad8ef3
...@@ -2588,11 +2588,18 @@ static void fm10k_io_resume(struct pci_dev *pdev) ...@@ -2588,11 +2588,18 @@ static void fm10k_io_resume(struct pci_dev *pdev)
if (err) if (err)
dev_warn(&pdev->dev, dev_warn(&pdev->dev,
"fm10k_io_resume failed: %d\n", err); "%s failed: %d\n", __func__, err);
else else
netif_device_attach(netdev); 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) static void fm10k_io_reset_prepare(struct pci_dev *pdev)
{ {
/* warn incase we have any active VF devices */ /* warn incase we have any active VF devices */
...@@ -2602,6 +2609,13 @@ static void fm10k_io_reset_prepare(struct pci_dev *pdev) ...@@ -2602,6 +2609,13 @@ static void fm10k_io_reset_prepare(struct pci_dev *pdev)
fm10k_prepare_suspend(pci_get_drvdata(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) static void fm10k_io_reset_done(struct pci_dev *pdev)
{ {
struct fm10k_intfc *interface = pci_get_drvdata(pdev); struct fm10k_intfc *interface = pci_get_drvdata(pdev);
...@@ -2609,7 +2623,7 @@ static void fm10k_io_reset_done(struct pci_dev *pdev) ...@@ -2609,7 +2623,7 @@ static void fm10k_io_reset_done(struct pci_dev *pdev)
if (err) { if (err) {
dev_warn(&pdev->dev, dev_warn(&pdev->dev,
"fm10k_io_reset_notify failed: %d\n", err); "%s failed: %d\n", __func__, err);
netif_device_detach(interface->netdev); netif_device_detach(interface->netdev);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment