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

Commit 8f3acca9 authored by Bjorn Helgaas's avatar Bjorn Helgaas
Browse files

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: default avatarBjorn Helgaas <bhelgaas@google.com>
parent ef83b078
Loading
Loading
Loading
Loading
+12 −10
Original line number Diff line number Diff line
@@ -344,13 +344,15 @@ static int pcie_device_init(struct pci_dev *pdev, int service, int irq)
	device_enable_async_suspend(device);

	retval = device_register(device);
	if (retval)
	if (retval) {
		kfree(pcie);
	else
		get_device(device);
		return retval;
	}

	get_device(device);
	return 0;
}

/**
 * pcie_port_device_register - register PCI Express port
 * @dev: PCI Express port to register
@@ -498,12 +500,12 @@ static int pcie_port_probe_service(struct device *dev)

	pciedev = to_pcie_device(dev);
	status = driver->probe(pciedev);
	if (!status) {
		dev_printk(KERN_DEBUG, dev, "service driver %s loaded\n",
			driver->name);
		get_device(dev);
	}
	if (status)
		return status;

	dev_printk(KERN_DEBUG, dev, "service driver %s loaded\n", driver->name);
	get_device(dev);
	return 0;
}

/**