mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
PCI: define PCI resource names in an 'enum'
This patch moves all definitions of the PCI resource names to an 'enum', and also replaces some hard-coded resource variables with symbol names. This change eases introduction of device specific resources. Reviewed-by: Bjorn Helgaas <[email protected]> Signed-off-by: Yu Zhao <[email protected]> Signed-off-by: Jesse Barnes <[email protected]>
This commit is contained in:
parent
14add80b51
commit
fde09c6d8f
4 changed files with 32 additions and 18 deletions
|
|
@ -102,11 +102,13 @@ resource_show(struct device * dev, struct device_attribute *attr, char * buf)
|
|||
struct pci_dev * pci_dev = to_pci_dev(dev);
|
||||
char * str = buf;
|
||||
int i;
|
||||
int max = 7;
|
||||
int max;
|
||||
resource_size_t start, end;
|
||||
|
||||
if (pci_dev->subordinate)
|
||||
max = DEVICE_COUNT_RESOURCE;
|
||||
else
|
||||
max = PCI_BRIDGE_RESOURCES;
|
||||
|
||||
for (i = 0; i < max; i++) {
|
||||
struct resource *res = &pci_dev->resource[i];
|
||||
|
|
|
|||
|
|
@ -423,7 +423,7 @@ static struct pci_bus *pci_alloc_child_bus(struct pci_bus *parent,
|
|||
child->subordinate = 0xff;
|
||||
|
||||
/* Set up default resource pointers and names.. */
|
||||
for (i = 0; i < 4; i++) {
|
||||
for (i = 0; i < PCI_BRIDGE_RESOURCE_NUM; i++) {
|
||||
child->resource[i] = &bridge->resource[PCI_BRIDGE_RESOURCES+i];
|
||||
child->resource[i]->name = child->name;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -361,15 +361,16 @@ static int show_device(struct seq_file *m, void *v)
|
|||
dev->vendor,
|
||||
dev->device,
|
||||
dev->irq);
|
||||
/* Here should be 7 and not PCI_NUM_RESOURCES as we need to preserve compatibility */
|
||||
for (i=0; i<7; i++) {
|
||||
|
||||
/* only print standard and ROM resources to preserve compatibility */
|
||||
for (i = 0; i <= PCI_ROM_RESOURCE; i++) {
|
||||
resource_size_t start, end;
|
||||
pci_resource_to_user(dev, i, &dev->resource[i], &start, &end);
|
||||
seq_printf(m, "\t%16llx",
|
||||
(unsigned long long)(start |
|
||||
(dev->resource[i].flags & PCI_REGION_FLAG_MASK)));
|
||||
}
|
||||
for (i=0; i<7; i++) {
|
||||
for (i = 0; i <= PCI_ROM_RESOURCE; i++) {
|
||||
resource_size_t start, end;
|
||||
pci_resource_to_user(dev, i, &dev->resource[i], &start, &end);
|
||||
seq_printf(m, "\t%16llx",
|
||||
|
|
|
|||
Loading…
Reference in a new issue