]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
net: atl1c: Make use of the helper function dev_err_probe()
authorCai Huoqing <caihuoqing@baidu.com>
Wed, 15 Sep 2021 14:57:48 +0000 (22:57 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 16 Sep 2021 12:35:35 +0000 (13:35 +0100)
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>
drivers/net/ethernet/atheros/atl1c/atl1c_main.c

index 3b51b172b3172b3933a029940620f33fc1c6bc26..20c032ab631b42533ddf3727984403b3d4002e81 100644 (file)
@@ -2662,10 +2662,8 @@ static int atl1c_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 
        /* enable device (incl. PCI PM wakeup and hotplug setup) */
        err = pci_enable_device_mem(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");
 
        /*
         * The atl1c chip can DMA to 64-bit addresses, but it uses a single