提交 a65da0c3 编写于 作者: M Maciej W. Rozycki 提交者: David S. Miller

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: NMaciej W. Rozycki <macro@linux-mips.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 37dd9255
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册