diff options
author | Gu Zheng <guz.fnst@cn.fujitsu.com> | 2013-05-25 09:48:31 -0400 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2013-06-05 15:49:36 -0400 |
commit | 8b1fce04dc2a2210f050484afa85acc3a81cfbba (patch) | |
tree | d790a4d12baf35c9f32cafde8386d505a7576067 /drivers/pci/probe.c | |
parent | 3c6e6ae770f338ef3e54c5823c21063204f53537 (diff) |
PCI: Convert alloc_pci_dev(void) to pci_alloc_dev(bus)
Use the new pci_alloc_dev(bus) to replace the existing using of
alloc_pci_dev(void).
[bhelgaas: drop pci_bus ref later in pci_release_dev()]
Signed-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com>
Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: David Airlie <airlied@linux.ie>
Cc: Neela Syam Kolli <megaraidlinux@lsi.com>
Cc: "James E.J. Bottomley" <JBottomley@parallels.com>
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'drivers/pci/probe.c')
-rw-r--r-- | drivers/pci/probe.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index d47ce1400c26..ed5ce185eed9 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c | |||
@@ -1132,6 +1132,7 @@ static void pci_release_dev(struct device *dev) | |||
1132 | pci_dev = to_pci_dev(dev); | 1132 | pci_dev = to_pci_dev(dev); |
1133 | pci_release_capabilities(pci_dev); | 1133 | pci_release_capabilities(pci_dev); |
1134 | pci_release_of_node(pci_dev); | 1134 | pci_release_of_node(pci_dev); |
1135 | pci_bus_put(pci_dev->bus); | ||
1135 | kfree(pci_dev); | 1136 | kfree(pci_dev); |
1136 | } | 1137 | } |
1137 | 1138 | ||
@@ -1270,11 +1271,10 @@ static struct pci_dev *pci_scan_device(struct pci_bus *bus, int devfn) | |||
1270 | if (!pci_bus_read_dev_vendor_id(bus, devfn, &l, 60*1000)) | 1271 | if (!pci_bus_read_dev_vendor_id(bus, devfn, &l, 60*1000)) |
1271 | return NULL; | 1272 | return NULL; |
1272 | 1273 | ||
1273 | dev = alloc_pci_dev(); | 1274 | dev = pci_alloc_dev(bus); |
1274 | if (!dev) | 1275 | if (!dev) |
1275 | return NULL; | 1276 | return NULL; |
1276 | 1277 | ||
1277 | dev->bus = bus; | ||
1278 | dev->devfn = devfn; | 1278 | dev->devfn = devfn; |
1279 | dev->vendor = l & 0xffff; | 1279 | dev->vendor = l & 0xffff; |
1280 | dev->device = (l >> 16) & 0xffff; | 1280 | dev->device = (l >> 16) & 0xffff; |
@@ -1282,6 +1282,7 @@ static struct pci_dev *pci_scan_device(struct pci_bus *bus, int devfn) | |||
1282 | pci_set_of_node(dev); | 1282 | pci_set_of_node(dev); |
1283 | 1283 | ||
1284 | if (pci_setup_device(dev)) { | 1284 | if (pci_setup_device(dev)) { |
1285 | pci_bus_put(dev->bus); | ||
1285 | kfree(dev); | 1286 | kfree(dev); |
1286 | return NULL; | 1287 | return NULL; |
1287 | } | 1288 | } |