From: Maciej W. Rozycki Date: Fri, 21 Nov 2014 14:09:52 +0000 (+0000) Subject: defxx: Fix DEFPA enable error propagation X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a65da0c3dac6e2d4f8ecf0aee8b0abe10001f2d9;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: David S. Miller --- diff --git a/drivers/net/fddi/defxx.c b/drivers/net/fddi/defxx.c index caed6eee289c..d8d4f3d3ca32 100644 --- a/drivers/net/fddi/defxx.c +++ b/drivers/net/fddi/defxx.c @@ -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);