Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a65da0c3 authored by Maciej W. Rozycki's avatar Maciej W. Rozycki Committed by David S. Miller
Browse files

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: default avatarMaciej W. Rozycki <macro@linux-mips.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 37dd9255
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -542,11 +542,14 @@ 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",
	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);