* [PATCH 4/91] get rid of pci_find_{device,subsys} arch/ppc
@ 2005-03-29 12:22 Amit Gud
2005-03-30 10:19 ` Amit Gud
0 siblings, 1 reply; 2+ messages in thread
From: Amit Gud @ 2005-03-29 12:22 UTC (permalink / raw)
To: greg; +Cc: linuxppc-dev, paulus, gud
Replace pci_find_{device,subsys} with pci_get_{device,subsys}.
Signed-off-by: Amit Gud <gud@eth.net>
---
diff -upr orig-2.6.12-rc1/arch/ppc/kernel/pci.c work-2.6.12-rc1/arch/ppc/kernel/pci.c
--- orig-2.6.12-rc1/arch/ppc/kernel/pci.c 2005-03-22 12:53:17.000000000 +0530
+++ work-2.6.12-rc1/arch/ppc/kernel/pci.c 2005-03-24 15:39:21.107111456 +0530
@@ -503,7 +503,7 @@ pcibios_allocate_resources(int pass)
u16 command;
struct resource *r;
- while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
+ while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
pci_read_config_word(dev, PCI_COMMAND, &command);
for (idx = 0; idx < 6; idx++) {
r = &dev->resource[idx];
@@ -519,7 +519,7 @@ pcibios_allocate_resources(int pass)
alloc_resource(dev, idx);
}
if (pass)
- continue;
+ goto dev_put;
r = &dev->resource[PCI_ROM_RESOURCE];
if (r->flags & PCI_ROM_ADDRESS_ENABLE) {
/* Turn the ROM off, leave the resource region, but keep it unregistered. */
@@ -530,6 +530,8 @@ pcibios_allocate_resources(int pass)
pci_write_config_dword(dev, dev->rom_base_reg,
reg & ~PCI_ROM_ADDRESS_ENABLE);
}
+ dev_put:
+ pci_dev_put(dev);
}
}
@@ -540,12 +542,12 @@ pcibios_assign_resources(void)
int idx;
struct resource *r;
- while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
+ while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
int class = dev->class >> 8;
/* Don't touch classless devices and host bridges */
if (!class || class == PCI_CLASS_BRIDGE_HOST)
- continue;
+ goto dev_put;
for (idx = 0; idx < 6; idx++) {
r = &dev->resource[idx];
@@ -571,6 +573,8 @@ pcibios_assign_resources(void)
if (r->end)
pci_assign_resource(dev, PCI_ROM_RESOURCE);
#endif
+ dev_put:
+ pci_dev_put(dev);
}
}
@@ -866,13 +870,18 @@ pci_device_from_OF_node(struct device_no
*/
if (!pci_to_OF_bus_map)
return 0;
- while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
+ while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
if (pci_to_OF_bus_map[dev->bus->number] != *bus)
- continue;
+ goto dev_put;
if (dev->devfn != *devfn)
- continue;
+ goto dev_put;
+
*bus = dev->bus->number;
+ pci_dev_put(dev);
return 0;
+
+ dev_put:
+ pci_dev_put(dev);
}
return -ENODEV;
}
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH 4/91] get rid of pci_find_{device,subsys} arch/ppc
2005-03-29 12:22 [PATCH 4/91] get rid of pci_find_{device,subsys} arch/ppc Amit Gud
@ 2005-03-30 10:19 ` Amit Gud
0 siblings, 0 replies; 2+ messages in thread
From: Amit Gud @ 2005-03-30 10:19 UTC (permalink / raw)
To: Amit Gud; +Cc: greg, paulus, linuxppc-dev
Amit Gud wrote:
> replace pci_find_{device,subsys} with pci_get_{device,subsys}
>
Please don't apply, its incorrect.
Sorry for the inconvenience.
Best,
AG
--
May the source be with you.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-03-30 10:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-29 12:22 [PATCH 4/91] get rid of pci_find_{device,subsys} arch/ppc Amit Gud
2005-03-30 10:19 ` Amit Gud
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.