From: Gu Zheng Date: Sat, 25 May 2013 13:48:30 +0000 (+0800) Subject: PCI: Introduce pci_alloc_dev(struct pci_bus*) to replace alloc_pci_dev() X-Git-Tag: omap-for-v3.11/fixes-for-merge-window~18^2~2^2~9 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3c6e6ae770f338ef3e54c5823c21063204f53537;p=pandora-kernel.git PCI: Introduce pci_alloc_dev(struct pci_bus*) to replace alloc_pci_dev() Here we introduce a new interface to replace alloc_pci_dev(): struct pci_dev *pci_alloc_dev(struct pci_bus *bus) It takes a "struct pci_bus *" argument, so we can alloc a PCI device on a target PCI bus, and it acquires a reference on the pci_bus. We use pci_alloc_dev(NULL) to simplify the old alloc_pci_dev(), and keep it for a while but mark it as __deprecated. Holding a reference to the pci_bus ensures that referencing pci_dev->bus is valid as long as the pci_dev is valid. [bhelgaas: keep existing "return error early" structure in pci_alloc_dev()] Signed-off-by: Gu Zheng Signed-off-by: Jiang Liu Signed-off-by: Bjorn Helgaas --- Reading git-diff-tree failed