diff options
author | Yinghai Lu <yinghai@kernel.org> | 2012-05-17 21:51:11 -0400 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2012-06-13 17:42:22 -0400 |
commit | b918c62e086b2130a7bae44110ca516ef10bfe5a (patch) | |
tree | e4aee0e76da9a6ddd2d787de63f4ae7ad4d10e59 /drivers/parisc/lba_pci.c | |
parent | 92f02430934ca1c1e991a1ab3541880575042697 (diff) |
PCI: replace struct pci_bus secondary/subordinate with busn_res
Replace the struct pci_bus secondary/subordinate members with the
struct resource busn_res. Later we'll build a resource tree of these
bus numbers.
[bhelgaas: changelog]
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/parisc/lba_pci.c')
-rw-r--r-- | drivers/parisc/lba_pci.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/parisc/lba_pci.c b/drivers/parisc/lba_pci.c index 052fa230bc77..cd8f9ce8720f 100644 --- a/drivers/parisc/lba_pci.c +++ b/drivers/parisc/lba_pci.c | |||
@@ -189,8 +189,8 @@ lba_dump_res(struct resource *r, int d) | |||
189 | 189 | ||
190 | static int lba_device_present(u8 bus, u8 dfn, struct lba_device *d) | 190 | static int lba_device_present(u8 bus, u8 dfn, struct lba_device *d) |
191 | { | 191 | { |
192 | u8 first_bus = d->hba.hba_bus->secondary; | 192 | u8 first_bus = d->hba.hba_bus->busn_res.start; |
193 | u8 last_sub_bus = d->hba.hba_bus->subordinate; | 193 | u8 last_sub_bus = d->hba.hba_bus->busn_res.end; |
194 | 194 | ||
195 | if ((bus < first_bus) || | 195 | if ((bus < first_bus) || |
196 | (bus > last_sub_bus) || | 196 | (bus > last_sub_bus) || |
@@ -364,7 +364,7 @@ lba_rd_cfg(struct lba_device *d, u32 tok, u8 reg, u32 size) | |||
364 | static int elroy_cfg_read(struct pci_bus *bus, unsigned int devfn, int pos, int size, u32 *data) | 364 | static int elroy_cfg_read(struct pci_bus *bus, unsigned int devfn, int pos, int size, u32 *data) |
365 | { | 365 | { |
366 | struct lba_device *d = LBA_DEV(parisc_walk_tree(bus->bridge)); | 366 | struct lba_device *d = LBA_DEV(parisc_walk_tree(bus->bridge)); |
367 | u32 local_bus = (bus->parent == NULL) ? 0 : bus->secondary; | 367 | u32 local_bus = (bus->parent == NULL) ? 0 : bus->busn_res.start; |
368 | u32 tok = LBA_CFG_TOK(local_bus, devfn); | 368 | u32 tok = LBA_CFG_TOK(local_bus, devfn); |
369 | void __iomem *data_reg = d->hba.base_addr + LBA_PCI_CFG_DATA; | 369 | void __iomem *data_reg = d->hba.base_addr + LBA_PCI_CFG_DATA; |
370 | 370 | ||
@@ -380,7 +380,7 @@ static int elroy_cfg_read(struct pci_bus *bus, unsigned int devfn, int pos, int | |||
380 | return 0; | 380 | return 0; |
381 | } | 381 | } |
382 | 382 | ||
383 | if (LBA_SKIP_PROBE(d) && !lba_device_present(bus->secondary, devfn, d)) { | 383 | if (LBA_SKIP_PROBE(d) && !lba_device_present(bus->busn_res.start, devfn, d)) { |
384 | DBG_CFG("%s(%x+%2x) -> -1 (b)\n", __func__, tok, pos); | 384 | DBG_CFG("%s(%x+%2x) -> -1 (b)\n", __func__, tok, pos); |
385 | /* either don't want to look or know device isn't present. */ | 385 | /* either don't want to look or know device isn't present. */ |
386 | *data = ~0U; | 386 | *data = ~0U; |
@@ -431,7 +431,7 @@ lba_wr_cfg(struct lba_device *d, u32 tok, u8 reg, u32 data, u32 size) | |||
431 | static int elroy_cfg_write(struct pci_bus *bus, unsigned int devfn, int pos, int size, u32 data) | 431 | static int elroy_cfg_write(struct pci_bus *bus, unsigned int devfn, int pos, int size, u32 data) |
432 | { | 432 | { |
433 | struct lba_device *d = LBA_DEV(parisc_walk_tree(bus->bridge)); | 433 | struct lba_device *d = LBA_DEV(parisc_walk_tree(bus->bridge)); |
434 | u32 local_bus = (bus->parent == NULL) ? 0 : bus->secondary; | 434 | u32 local_bus = (bus->parent == NULL) ? 0 : bus->busn_res.start; |
435 | u32 tok = LBA_CFG_TOK(local_bus,devfn); | 435 | u32 tok = LBA_CFG_TOK(local_bus,devfn); |
436 | 436 | ||
437 | if ((pos > 255) || (devfn > 255)) | 437 | if ((pos > 255) || (devfn > 255)) |
@@ -444,7 +444,7 @@ static int elroy_cfg_write(struct pci_bus *bus, unsigned int devfn, int pos, int | |||
444 | return 0; | 444 | return 0; |
445 | } | 445 | } |
446 | 446 | ||
447 | if (LBA_SKIP_PROBE(d) && (!lba_device_present(bus->secondary, devfn, d))) { | 447 | if (LBA_SKIP_PROBE(d) && (!lba_device_present(bus->busn_res.start, devfn, d))) { |
448 | DBG_CFG("%s(%x+%2x) = 0x%x (b)\n", __func__, tok, pos,data); | 448 | DBG_CFG("%s(%x+%2x) = 0x%x (b)\n", __func__, tok, pos,data); |
449 | return 1; /* New Workaround */ | 449 | return 1; /* New Workaround */ |
450 | } | 450 | } |
@@ -481,7 +481,7 @@ static struct pci_ops elroy_cfg_ops = { | |||
481 | static int mercury_cfg_read(struct pci_bus *bus, unsigned int devfn, int pos, int size, u32 *data) | 481 | static int mercury_cfg_read(struct pci_bus *bus, unsigned int devfn, int pos, int size, u32 *data) |
482 | { | 482 | { |
483 | struct lba_device *d = LBA_DEV(parisc_walk_tree(bus->bridge)); | 483 | struct lba_device *d = LBA_DEV(parisc_walk_tree(bus->bridge)); |
484 | u32 local_bus = (bus->parent == NULL) ? 0 : bus->secondary; | 484 | u32 local_bus = (bus->parent == NULL) ? 0 : bus->busn_res.start; |
485 | u32 tok = LBA_CFG_TOK(local_bus, devfn); | 485 | u32 tok = LBA_CFG_TOK(local_bus, devfn); |
486 | void __iomem *data_reg = d->hba.base_addr + LBA_PCI_CFG_DATA; | 486 | void __iomem *data_reg = d->hba.base_addr + LBA_PCI_CFG_DATA; |
487 | 487 | ||
@@ -514,7 +514,7 @@ static int mercury_cfg_write(struct pci_bus *bus, unsigned int devfn, int pos, i | |||
514 | { | 514 | { |
515 | struct lba_device *d = LBA_DEV(parisc_walk_tree(bus->bridge)); | 515 | struct lba_device *d = LBA_DEV(parisc_walk_tree(bus->bridge)); |
516 | void __iomem *data_reg = d->hba.base_addr + LBA_PCI_CFG_DATA; | 516 | void __iomem *data_reg = d->hba.base_addr + LBA_PCI_CFG_DATA; |
517 | u32 local_bus = (bus->parent == NULL) ? 0 : bus->secondary; | 517 | u32 local_bus = (bus->parent == NULL) ? 0 : bus->busn_res.start; |
518 | u32 tok = LBA_CFG_TOK(local_bus,devfn); | 518 | u32 tok = LBA_CFG_TOK(local_bus,devfn); |
519 | 519 | ||
520 | if ((pos > 255) || (devfn > 255)) | 520 | if ((pos > 255) || (devfn > 255)) |
@@ -636,7 +636,7 @@ lba_fixup_bus(struct pci_bus *bus) | |||
636 | struct lba_device *ldev = LBA_DEV(parisc_walk_tree(bus->bridge)); | 636 | struct lba_device *ldev = LBA_DEV(parisc_walk_tree(bus->bridge)); |
637 | 637 | ||
638 | DBG("lba_fixup_bus(0x%p) bus %d platform_data 0x%p\n", | 638 | DBG("lba_fixup_bus(0x%p) bus %d platform_data 0x%p\n", |
639 | bus, bus->secondary, bus->bridge->platform_data); | 639 | bus, (int)bus->busn_res.start, bus->bridge->platform_data); |
640 | 640 | ||
641 | /* | 641 | /* |
642 | ** Properly Setup MMIO resources for this bus. | 642 | ** Properly Setup MMIO resources for this bus. |
@@ -1511,7 +1511,7 @@ lba_driver_probe(struct parisc_device *dev) | |||
1511 | return 0; | 1511 | return 0; |
1512 | } | 1512 | } |
1513 | 1513 | ||
1514 | lba_bus->subordinate = pci_scan_child_bus(lba_bus); | 1514 | lba_bus->busn_res.end = pci_scan_child_bus(lba_bus); |
1515 | 1515 | ||
1516 | /* This is in lieu of calling pci_assign_unassigned_resources() */ | 1516 | /* This is in lieu of calling pci_assign_unassigned_resources() */ |
1517 | if (is_pdc_pat()) { | 1517 | if (is_pdc_pat()) { |
@@ -1541,7 +1541,7 @@ lba_driver_probe(struct parisc_device *dev) | |||
1541 | lba_dev->flags |= LBA_FLAG_SKIP_PROBE; | 1541 | lba_dev->flags |= LBA_FLAG_SKIP_PROBE; |
1542 | } | 1542 | } |
1543 | 1543 | ||
1544 | lba_next_bus = lba_bus->subordinate + 1; | 1544 | lba_next_bus = lba_res->busn_res.end + 1; |
1545 | pci_bus_add_devices(lba_bus); | 1545 | pci_bus_add_devices(lba_bus); |
1546 | 1546 | ||
1547 | /* Whew! Finally done! Tell services we got this one covered. */ | 1547 | /* Whew! Finally done! Tell services we got this one covered. */ |