sunhme: forward the error code from pci_enable_device()
authorRolf Eike Beer <eike-kernel@sf-tec.de>
Sat, 24 Sep 2022 01:53:29 +0000 (21:53 -0400)
committerJakub Kicinski <kuba@kernel.org>
Tue, 27 Sep 2022 00:45:36 +0000 (17:45 -0700)
This already returns a proper error value, so pass it to the caller.

Signed-off-by: Rolf Eike Beer <eike-kernel@sf-tec.de>
Signed-off-by: Sean Anderson <seanga2@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/sun/sunhme.c

index 7340d0f..63a7cac 100644 (file)
@@ -2940,11 +2940,11 @@ static int happy_meal_pci_probe(struct pci_dev *pdev,
                strcpy(prom_name, "SUNW,hme");
 #endif
 
-       err = -ENODEV;
-
-       if (pci_enable_device(pdev))
+       err = pci_enable_device(pdev);
+       if (err)
                goto err_out;
        pci_set_master(pdev);
+       err = -ENODEV;
 
        if (!strcmp(prom_name, "SUNW,qfe") || !strcmp(prom_name, "qfe")) {
                qp = quattro_pci_find(pdev);