defxx: Fix DEFPA enable error propagation

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>
This commit is contained in:
Maciej W. Rozycki 2014-11-21 14:09:52 +00:00 committed by David S. Miller
parent 37dd9255b2
commit a65da0c3da
1 changed files with 7 additions and 4 deletions

View 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);