defxx: Fix DEFPA enable error propagation
authorMaciej W. Rozycki <macro@linux-mips.org>
Fri, 21 Nov 2014 14:09:52 +0000 (14:09 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 21 Nov 2014 21:37:13 +0000 (16:37 -0500)
Correctly propagate the error code from `pci_enable_device' if non zero.
Currently a failure of this function is correctly recognized and device
initialization abandoned, however a successful completion code returned.

Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/fddi/defxx.c

index caed6eee289c3a65a38bb9bb1a711617dd8d5134..d8d4f3d3ca3287a6ac7ee81ae80eabd14afb0425 100644 (file)
@@ -542,10 +542,13 @@ static int dfx_register(struct device *bdev)
        }
 
        /* Enable PCI device. */
-       if (dfx_bus_pci && pci_enable_device(to_pci_dev(bdev))) {
-               printk(KERN_ERR "%s: Cannot enable PCI device, aborting\n",
-                      print_name);
-               goto err_out;
+       if (dfx_bus_pci) {
+               err = pci_enable_device(to_pci_dev(bdev));
+               if (err) {
+                       pr_err("%s: Cannot enable PCI device, aborting\n",
+                              print_name);
+                       goto err_out;
+               }
        }
 
        SET_NETDEV_DEV(dev, bdev);