summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/chelsio
diff options
context:
space:
mode:
authorCai Huoqing <caihuoqing@baidu.com>2021-09-15 22:58:11 +0800
committerDavid S. Miller <davem@davemloft.net>2021-09-16 13:35:35 +0100
commit9eda994d4b57e177a1e05416458e95ae7cac6c40 (patch)
treefbe47c1239fcb7b6d84f4fdb8dda86356039bb1b /drivers/net/ethernet/chelsio
parentb0ab7096dd9bf4d6d5c9d889ab216eb78f7e0b04 (diff)
downloadlwn-9eda994d4b57e177a1e05416458e95ae7cac6c40.tar.gz
lwn-9eda994d4b57e177a1e05416458e95ae7cac6c40.zip
net: chelsio: cxgb4vf: Make use of the helper function dev_err_probe()
When possible use dev_err_probe help to properly deal with the PROBE_DEFER error, the benefit is that DEFER issue will be logged in the devices_deferred debugfs file. And using dev_err_probe() can reduce code size, and simplify the code. Signed-off-by: Cai Huoqing <caihuoqing@baidu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/chelsio')
-rw-r--r--drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c b/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
index 49b76fd47daa..4920a80a0460 100644
--- a/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
@@ -2902,10 +2902,8 @@ static int cxgb4vf_pci_probe(struct pci_dev *pdev,
* Initialize generic PCI device state.
*/
err = pci_enable_device(pdev);
- if (err) {
- dev_err(&pdev->dev, "cannot enable PCI device\n");
- return err;
- }
+ if (err)
+ return dev_err_probe(&pdev->dev, err, "cannot enable PCI device\n");
/*
* Reserve PCI resources for the device. If we can't get them some