diff options
author | Cai Huoqing <caihuoqing@baidu.com> | 2021-09-15 22:58:34 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-09-16 13:35:35 +0100 |
commit | 4fd3ff3b29aebd271db5b74275adfa5d1505883d (patch) | |
tree | df753029ffb86520dc972f03b052cc781768210d /drivers/net/ethernet/huawei/hinic/hinic_main.c | |
parent | 015a22f46b25d12f28efcce28039019ec504cb13 (diff) | |
download | lwn-4fd3ff3b29aebd271db5b74275adfa5d1505883d.tar.gz lwn-4fd3ff3b29aebd271db5b74275adfa5d1505883d.zip |
net: hinic: 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/huawei/hinic/hinic_main.c')
-rw-r--r-- | drivers/net/ethernet/huawei/hinic/hinic_main.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/net/ethernet/huawei/hinic/hinic_main.c b/drivers/net/ethernet/huawei/hinic/hinic_main.c index ae707e305684..9965e8d5d0a9 100644 --- a/drivers/net/ethernet/huawei/hinic/hinic_main.c +++ b/drivers/net/ethernet/huawei/hinic/hinic_main.c @@ -1379,10 +1379,8 @@ static int hinic_probe(struct pci_dev *pdev, { int err = pci_enable_device(pdev); - if (err) { - dev_err(&pdev->dev, "Failed to enable PCI device\n"); - return err; - } + if (err) + return dev_err_probe(&pdev->dev, err, "Failed to enable PCI device\n"); err = pci_request_regions(pdev, HINIC_DRV_NAME); if (err) { |