PCI/portdrv: Cleanup error paths
Make the straightline path the normal no-error path. Check for errors and return them directly, instead of checking for success and putting the normal path in an "if" body. No functional change. Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
This commit is contained in:
parent
ef83b0781a
commit
8f3acca9ac
@ -344,11 +344,13 @@ static int pcie_device_init(struct pci_dev *pdev, int service, int irq)
|
|||||||
device_enable_async_suspend(device);
|
device_enable_async_suspend(device);
|
||||||
|
|
||||||
retval = device_register(device);
|
retval = device_register(device);
|
||||||
if (retval)
|
if (retval) {
|
||||||
kfree(pcie);
|
kfree(pcie);
|
||||||
else
|
return retval;
|
||||||
get_device(device);
|
}
|
||||||
return retval;
|
|
||||||
|
get_device(device);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -498,12 +500,12 @@ static int pcie_port_probe_service(struct device *dev)
|
|||||||
|
|
||||||
pciedev = to_pcie_device(dev);
|
pciedev = to_pcie_device(dev);
|
||||||
status = driver->probe(pciedev);
|
status = driver->probe(pciedev);
|
||||||
if (!status) {
|
if (status)
|
||||||
dev_printk(KERN_DEBUG, dev, "service driver %s loaded\n",
|
return status;
|
||||||
driver->name);
|
|
||||||
get_device(dev);
|
dev_printk(KERN_DEBUG, dev, "service driver %s loaded\n", driver->name);
|
||||||
}
|
get_device(dev);
|
||||||
return status;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user