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

Commit e75f34ce authored by Bjorn Helgaas's avatar Bjorn Helgaas
Browse files

PCI/portdrv: Remove extra get_device()/put_device() for pcie_device



Previously pcie_device_init() called get_device() if device_register() for
the new pcie_device succeeded, and remove_iter() called put_device() when
removing before unregistering the device.

But device_register() already increments the reference count in
device_add(), so we don't need to do it again here.

Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
parent f3986205
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -349,7 +349,6 @@ static int pcie_device_init(struct pci_dev *pdev, int service, int irq)
		return retval;
	}

	get_device(device);
	return 0;
}

@@ -456,10 +455,8 @@ int pcie_port_device_resume(struct device *dev)

static int remove_iter(struct device *dev, void *data)
{
	if (dev->bus == &pcie_port_bus_type) {
		put_device(dev);
	if (dev->bus == &pcie_port_bus_type)
		device_unregister(dev);
	}
	return 0;
}